Auth Shell
The centered single-column screen every auth flow uses — sign in, sign up, reset password, verify email.
The centered single-column screen every auth flow uses: sign in, sign up, forgot/reset password, verify email, resend verification, OAuth callback.
Yunxin hand-rolls this shell nine times — each copy re-deriving the viewport centring, the column width, the brand row spacing and the card chrome. This is a straight extraction of that markup, class for class: Yunxin is the original and stays the reference, so a screen that adopts AuthShell renders identically to the copy it replaces.
That is also why the panel is p-6 bg-card border border-border rounded-xl and not the house .card class. .card is a 20px radius with a shadow and a hover transition — swapping it in would have quietly restyled all nine screens.
Import
1import { AuthShell } from "@yuhuanowo/yunui/patterns";Basic
AuthShell fills the viewport (min-h-dvh); the preview below is scaled down inside a frame.
Sign in
Slots
brand— the logo/wordmark row above the card. PasshomeHrefand it becomes a link home, with the samegap-2.5 mb-8row Yunxin uses.title/subtitle— centered heading and supporting line. The heading's bottom margin follows Yunxin:mb-2when there is a subtitle,mb-6when there is not.error— a failed submit, rendered in the soft-error box these screens share. Falsy values render nothing, soerror={submitError}is safe.icon— a medallion or spinner above the heading, for confirmation and status screens.centered— centers everything in the card, for "check your email" style screens.footer— muted content under the card.width—sm(default) for a sign-in form,mdfor the wider error / not-found screens.
Anything that varies per screen stays in children. The shell owns only what is identical in all nine copies.
Failed submit
Errors do not get their own layout — they slot above the form in the box every one of these screens already uses.
With an error
Sign in
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| brand | ReactNode | — | Brand row above the card — the logo + wordmark. Rendered inside a centered flex row; pass the image and the name as siblings. |
| cardClassName | string | — | Extra classes on the card box itself (the wrapper takes `className`). |
| centered | boolean | false | Centers everything in the card — for confirmation and status screens. |
| children* | ReactNode | — | The form (or whatever the screen is for). |
| error | ReactNode | — | A block above the form for a failed submit — rendered in the soft-error box these screens all use. Falsy values render nothing. |
| footer | ReactNode | — | Content under the card — "Don't have an account?", legal links. |
| homeHref | string | — | When set, the brand row becomes a link to this destination (usually "/"). |
| icon | ReactNode | — | Optional medallion / spinner above the heading, centered. |
| subtitle | ReactNode | — | Optional line under the heading. |
| title | ReactNode | — | Card heading. |
| width | "sm" | "md" | sm | Width of the column. `sm` suits a sign-in form; `md` suits the wider error / not-found screens. |