SSO sign-in
Shown as Postern, a made-up product
A passwordless sign-in for a bookkeeping app that spots a company's SSO from the email, with passkeys, a six-digit code and a workspace picker by data region, beside a ledger that reconciles to £0.00.
Installation
pnpm dlx shadcn@latest add "https://propui.dev/r/postern-signin.json?token=…"Adds the piece to components/propui/11-postern-signin/ and installs motion. Needs a free account: sign in and the command includes your token. Fonts load from Prop UI; download the zip to self-host them.
When to use
Reach for it when
- A passwordless sign-in for a business app where some companies must come in through their own single sign-on.
- Sign-in for a product with several workspaces per person, each kept in its own data region.
- A full-screen login that shows the product's work beside the form instead of a marketing panel.
Something else fits when
- A passkey-first login with one workspace: Passkey login keeps to that path.
- Creating an account from an invitation: Sign-up shows what you are joining.
- Confirming one action with a code after sign-in: Code input is built for that.
Usage
Fills a full window: give it a container with a definite height.
import Piece from "@/components/propui/11-postern-signin/Section";
export default function Page() {
return (
<main className="h-dvh w-full overflow-hidden">
<Piece />
</main>
);
}Change the companies, workspaces, remembered account and ledger lines in data.ts, and pass onSignIn to Postern to hand the account, method and workspace to your app. Replace the simulated code, passkey and SSO steps in Postern.tsx with your auth calls.
Your data
Replace these and everything on screen follows.
ORGS{ domain; name; hue; policy: "sso" | "open"; idp; workspaces }[]- The company found from the email domain, whether SSO is required, and the workspace picker.
REMEMBERED{ name; email; hue; method; when }- The remembered account at the top of the email step.
DEMO_CODE, RESEND_SECONDSstring, number- The code that verifies and the resend countdown.
DOMAIN_FIXESRecord<string, string>- The Did you mean suggestion for mistyped domains.
LINES{ id; date; payee; amount; entry; account }[]- The bank feed lines that pair with ledger entries on the dark side.
CLOSE_TOTAL, CLOSE_DONEnumber- The month-end close bar under the ledger.
onSignIn(account, method, workspace) => void- Called once the person is signed in to a workspace.
Interactions
- Click the remembered account to sign in with its passkey.
- Type a work email: a known domain shows the company, and a company that requires SSO turns the button into Continue with SSO.
- Mistype a known domain to get a one-click Did you mean fix.
- Enter the six-digit code by typing, pasting or autofill; the sixth digit checks it, and a wrong code shakes the row and says so.
- Resend the code once the 30-second countdown ends, switch to a passkey, or change the email.
- Cancel a passkey or SSO hand-off while it waits; the email step says it was cancelled.
- Pick a workspace by name, role and data region, choose whether to remember the device, and open it.
- Once signed in, see the workspace, role, region, method and device memory, and sign out.
- Open Try a state to jump to any step and copy the demo code.
Keyboard
- Enter
- Continue from the email, submit the code or open the chosen workspace.
- Esc
- Go back from the verify and workspace steps, or close the Try a state menu.
- ←or→
- In the code, move between slots.
- Backspace
- In the code, clear the slot, or move back when it is empty.
- ↑or↓
- Move between workspaces, or between items in the Try a state menu.
Behaviour
Read from the code: roles, motion, breakpoints and what runs.
Accessibility
- The step rail is an ordered list with aria-current on the current step and each step's state spelled out for screen readers.
- Each step moves focus to its first control or its heading.
- Hints, typo fixes, company detection and errors share one line under the field, tied to it with aria-describedby; errors are announced as alerts.
- Every step change is announced through a polite status region.
- Workspaces are native radios in a fieldset; the remember-device option is a native checkbox.
- Busy buttons use aria-busy and aria-disabled so they stay in the tab order.
- The ledger side is a labelled aside, and each row says whether it is matched to its entry.
Motion
- On load the six bank lines pair with their ledger entries one by one: a connector draws, the entry slides in, a tick lands, and the figure rolls down to £0.00.
- Steps slide and fade in the direction of travel; button labels cross-fade in place.
- The code row has a gliding focus ring, shakes on a wrong code, and the resend timer's digits roll.
- While a hand-off waits, a light runs along the line between the two marks.
- Reduced motion shows the settled ledger and swaps movement for instant changes.
Responsive
- Above 1000px the ledger and the sign-in split the screen, and the ledger stays in place while the form scrolls.
- Below 1000px the sign-in comes first and the ledger follows it below.
- Below 560px the ledger drops the date and account columns, the keys hint hides, and workspace rows stack their region under the name.
- Below 400px the SSO tag shows only its shield.
Performance
- Timers run only for the ledger's opening sequence, the simulated steps and the resend countdown.
- No images: Inter in one variable file and inline SVG marks.
Notes for AI
Give your coding assistant the Markdown, not a screenshot.
- Keep every company, account and ledger line in data.ts; the form and the ledger read them from there.
- Keep the one fixed message line under the email field so nothing below it moves.
- Light and dark: keep colours in the tokens at the top of post.css. The ledger side stays dark in both themes.
/p/postern-signin/markdownThe whole library for assistants: llms.txt, or the MCP server in AI tools and MCP.