Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Passwordless Login Block for React

A full-height method picker for a podcast app: four hairline radio rows (email link, passkey, text code, authenticator app), a cell that says what happens next for the chosen way, and one button whose label follows the choice.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Let people choose how to get in without a password, with this passwordless login block for React with Base UI. It's the sign-in page of Echoburrow, a podcast app: the page's side rails run the full height of the screen and one band crosses it between two rules, holding a centred column that says which account is signing in. Four ways sit in one hairline group as native radio rows: an email link, a passkey, a text code and an authenticator app. Each has an icon in a tile that fills when its row is chosen, a start bar and a tint. Under the rows one cell says what happens next for the chosen way, and the Shine Button, the only colored control, takes its label from the choice. Pressing it waits a moment and shows, in the same space, what the app would do now, with "Choose another way" to go back. It's built from Button, Shine Button and Guides around plain radio inputs, with a CSS entrance only. For media, community and consumer apps that offer more than one way in.

FAQ

What stays in the page, and how do I start each method for real?

Everything: the choice, the next-line cell and the button are local state, and each result says what Echoburrow would do and that this demo did nothing. In a product, the button starts the chosen method with your auth endpoint: send the link, ask the browser for a passkey with navigator.credentials.get(), send the text code, or show the field for an authenticator code. The account and the masked address and phone are typed constants here; read them from the first step of your own sign-in.

Why are the rows native radio buttons?

A choice of one among a few is what radios are for, and the browser gives the arrow keys, the group name and the checked state for free. Each row is a label around a visually hidden radio, so a click anywhere on it chooses it, the focus ring is drawn on the row, and the radio is named by its title and described by its hint. They need no library, so every version behaves the same.

How does the page keep its height when the next line changes?

All four sentences share one grid cell and the unchosen ones are invisible, so the cell is as tall as the longest and nothing moves when you choose. On a phone the rows drop their hint lines (a screen reader still reads them) to keep the button on the first screen.

Which method should be the default?

Offer the strongest one your visitor can use first. Echoburrow starts on the passkey, since it can't be phished and needs nothing typed; a text code is the weakest of the four, because phone numbers can be taken over, so keep it for people who have nothing better. Whatever you pick, keep a password route for people who want one, as the link under the button does here.

Does the page reveal which methods an account has?

Here it lists all four for one typed account. In a product, listing only the methods a person has set up tells a stranger who typed that address what they use. Ask for the identifier first, then show the methods, and show the same generic list for unknown addresses if that is a risk for you.

  • Pro

    Magic Link Login

    Passwordless

    A full-height passwordless sign-in for a newsletter tool: one email field, then a Check your inbox state with a drawn envelope, a Resend button that really waits 30 seconds, and a way to change the address.

  • Pro

    Passkey Login

    Passwordless

    An online bank's sign-in page and its passkey chooser shown open over a drawn sign-in screen: two passkeys as radio rows, Cancel and Continue, a verifying step and a signed-in result, with the real dialog behind the Use your passkey button.

  • Pro

    Phone Auth Login

    Codes and approvals

    A start-aligned phone sign-in for a carpool app: a country select, a phone field that lays the number out as you type for that country with a length check, then a six-digit code and a signed-in result.

  • Pro

    WebAuthn Login

    Passwordless

    The add-a-passkey page a code host shows after a password sign-in: a three-step setup (where, name, done) with Back, Not now and a Dont ask again box, beside a note on what a passkey is.

  • Pro

    QR Code Login

    Passwordless

    A reverse-split sign-in for a TV app: a real QR code of a typed pairing link first on the screen, three numbered steps that tick off, a button that plays the phone scan and approval, Refresh code and a signed-in result.

  • Pro

    An identifier-first sign-in for an invoicing app: one email field, a lookup against two typed accounts, then either the password step with the address kept as a badge or account creation with the address carried over.