Skip to content
rw3iss Auth

ProviderIcon

atom @rw3iss/auth-client/preact/atoms/ProviderIcon framework-adapters/preact/components/atoms/ProviderIcon.tsx ↗

The provider’s icon, with two deliberate degrades:

  • no iconUrl → a monogram from the provider’s name;
  • the image 404s / fails to load → the SAME monogram, swapped in on the error event.

A broken-image glyph inside a sign-in button is worse than no icon at all, and neither is worth losing the button over.

The image is DECORATIVE (alt=""): the name sits next to it, and in icon-only mode the button carries an aria-label. Announcing the logo too would just repeat it.

Usage

import { ProviderIcon } from '@rw3iss/auth-client/preact/atoms';
<ProviderIcon />

Props

NameTypeDescription
providerProviderIdentity | nullSkip resolution and render this identity.
clientAuthClient
sizenumberBox size in px (both dimensions). Default 20.
radiusnumberCorner radius in px. Default 4. Pass 999 for a circle.
classNamestring