Component
Social Auth Button
Branded social sign-in buttons for Google, GitHub, Microsoft, and Apple, with a responsive row layout. Built on the outline Button.
Basic
One button per provider, each with its brand icon and a "Continue with …" label.
Installation
$
pnpm add @refraction-ui/react-social-auth-buttonUsage
tsx
import {
SocialAuthButton,
SocialAuthRow,
} from '@refraction-ui/react-social-auth-button'
export function SignIn() {
return (
<SocialAuthRow>
<SocialAuthButton provider="google" lastUsed onClick={signInWithGoogle} />
<SocialAuthButton provider="github" onClick={signInWithGitHub} />
<SocialAuthButton provider="microsoft" onClick={signInWithMicrosoft} />
<SocialAuthButton provider="apple" onClick={signInWithApple} />
</SocialAuthRow>
)
}States
Loading swaps the brand icon for a spinner and disables interaction. Disabled greys out the button.
Last used
Highlight the provider the returning user signed in with last using a floating badge.
Last used
Row
SocialAuthRow lays buttons out in a single column on mobile and two columns from the sm breakpoint up.
Last used
SocialAuthButton props
| Prop | Type | Default | Description |
|---|---|---|---|
provider | 'google' | 'github' | 'microsoft' | 'apple' | -- | Identity provider this button authenticates against. Determines the brand icon and label. |
lastUsed | boolean | false | Renders a floating "Last used" badge marking the provider the user signed in with last. |
loading | boolean | false | Shows a spinner and disables interaction. |
disabled | boolean | false | Disables the button. |
onClick | (e: MouseEvent) => void | -- | Click handler — start the OAuth flow here. Button props pass through. |
className | string | -- | Additional CSS classes applied to the underlying button. |
SocialAuthRow props
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | -- | SocialAuthButton elements to lay out. |
className | string | -- | Additional CSS classes applied to the grid container. |