Skip to content
rw3iss Auth

SignInWithProvider

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

Which label fits width px. Pure, and exported so the thresholds are testable without a DOM — the ResizeObserver path is just this plus a setState.

Usage

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

Props

NameTypeDescription
providerProviderIdentity | nullHost-supplied identity — skips the fetch entirely.
clientAuthClientBypass context lookup of the AuthClient.
variant'color' | 'outline' | 'dark'`color` uses the provider’s own brand colors when it published them; `outline` is neutral; `dark` matches the SSO dark buttons. Default `color` (falls back to outline styling with no colors).
size'sm' | 'md' | 'lg'
iconOnlybooleanForce icon-only (still fully labelled for screen readers).
shortNamebooleanForce the abbreviated name, whatever the available width.
labelstringReplace the full label text. The accessible name follows it.
hrefstringRender an instead of a
targetstringAnchor target. `_blank` gets rel=“noopener noreferrer” added.
onClick(event: MouseEvent) => void
disabledboolean
loadingbooleanRenders a busy state (aria-busy + disabled) during a redirect.
requireMethodProviderAuthMethod | ProviderAuthMethod[] | falseMethod(s) the deployment must support, or `false` to never gate. Default `[‘oidc’, ‘fedcm’]`.
responsivebooleanSet false to always render the full label. Default true.
classNamestringCustom widths (px) for the label swaps. Passing these switches to the measured path, since CSS can’t read a runtime value.