Social auth buttons
Sign-in buttons for Google, GitHub, Apple and Microsoft — the name, no logo — each with its own pending state.
Each button runs its own pending state off whatever onSelect returns, through AsyncButton: a slow redirect spins the button the reader pressed and leaves the others alone, which is the only honest thing to show while one of four requests is in flight. No mark is drawn by default — not a provider's logo, and not a look-alike of one: the button says where it signs in, which is the one thing it has to say. icons takes a mark per provider: drop in the provider's official mark under its brand terms, and it is drawn before the name and hidden from assistive technology, since the name already says it. Every button is one width with its label centred, stacked or in a row: a row is a grid of equal columns, as many to a line as hold "Continue with Microsoft" beside an icon (13rem), with the rest wrapping, and no column is wider than the row — so a phone gets a column instead of buttons spilling off the page. The label is a function of the provider, so a page that says "Sign up with" rather than "Continue with" changes one prop instead of four strings. onSelect is the provider that was chosen rather than the DOM select event, so it replaces the div prop of that name rather than intersecting with it.
Install
npx shadcn@latest add @vibra/social-auth-buttonsNeeds the @vibra registry in your components.json — set it up once.
Examples
With icons
Neutral stand-ins where each provider's official mark goes.