Skip to content
Eskais UI

Accounts

Auth Page

AuthPage: a centred, brand-led page for signing in, registering from a one-time link and recovering an account, with a logo, a title, a description, one primary action, other options, an alert slot and footer links. `status` (idle, working, error, success) marks the action pending and announces `workingLabel` while a ceremony such as WebAuthn is open, shows the error in a live destructive Alert with a retry, and swaps the actions for a success slot. It holds no auth logic.

Example

Northwind

Sign in to Northwind

Use the passkey saved on this device or your phone.

Installation

npx shadcn@latest add @eskais/auth-page
Brings alongalertbutton

Usage

Import
import { AuthPage } from "@/components/ui/auth-page"

The page for signing in with a passkey, registering from a one-time link or recovering an account: map your ceremony's state to status, put fields in children, other ways in under secondary and terms and privacy in footer.

API reference

AuthPage

PropTypeDefault
logoThe brand lockup, above the title.ReactNode–
titlerequiredReactNode–
headingLevel1 | 21
as`div` when the page already has its `<main>`, like a preview inside another page."main" | "div""main"
descriptionReactNode–
status`working` marks the primary action pending and announces `workingLabel`; `error` shows `error` in a destructive alert with `retry`; `success` replaces the actions with `success`. `idle` by default."idle" | "working" | "error" | "success""idle"
actionThe button that does the page's one job: sign in with a passkey, create the account, recover it.AuthPageAction–
workingLabelRead politely while `status` is `working`, like "Waiting for your passkey".string–
errorShown in a live destructive alert while `status` is `error`.ReactNode–
retryThe alert's retry button, while `status` is `error`.AuthPageRetry–
alertA note above the action in any status, like an Alert saying who invited you.ReactNode–
successShown instead of the action and `secondary` while `status` is `success`.ReactNode–
childrenFields or text between the description and the action.ReactNode–
secondaryOther ways in, under the action: another device, a recovery code, a link to sign in instead.ReactNode–
footerLinks under the card: terms, privacy, help.ReactNode–

Also takes <div> attributes except title, children.

Other exports

type AuthPageActiontype AuthPagePropstype AuthPageRetrytype AuthStatus

Accessibility

  • The card is the page's main landmark, with the title as its only h1.
  • While working, the action keeps focus with aria-busy and ignores presses, and workingLabel is read once, politely; it empties outside working so the next attempt is read again.
  • An error is a live destructive alert, read at once, with its retry beside it; success is a status, read when it appears.
  • The padding clears the notch and home indicator, and the card fills a 390px phone.

Agent actions

Agents press the primary action and the retry by their text; the page's own fields are UI SDK controls agents fill by their labels.

Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.