YuhuanStudioYunUIDocs
Patterns

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

tsx
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

YunUI

Sign in

Don't have an account? Sign up

Slots

  • brand — the logo/wordmark row above the card. Pass homeHref and it becomes a link home, with the same gap-2.5 mb-8 row Yunxin uses.
  • title / subtitle — centered heading and supporting line. The heading's bottom margin follows Yunxin: mb-2 when there is a subtitle, mb-6 when there is not.
  • error — a failed submit, rendered in the soft-error box these screens share. Falsy values render nothing, so error={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.
  • widthsm (default) for a sign-in form, md for 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

Incorrect email or password.

Props

PropTypeDefaultDescription
brandReactNodeBrand row above the card — the logo + wordmark. Rendered inside a centered flex row; pass the image and the name as siblings.
cardClassNamestringExtra classes on the card box itself (the wrapper takes `className`).
centeredbooleanfalseCenters everything in the card — for confirmation and status screens.
children*ReactNodeThe form (or whatever the screen is for).
errorReactNodeA block above the form for a failed submit — rendered in the soft-error box these screens all use. Falsy values render nothing.
footerReactNodeContent under the card — "Don't have an account?", legal links.
homeHrefstringWhen set, the brand row becomes a link to this destination (usually "/").
iconReactNodeOptional medallion / spinner above the heading, centered.
subtitleReactNodeOptional line under the heading.
titleReactNodeCard heading.
width"sm" | "md"smWidth of the column. `sm` suits a sign-in form; `md` suits the wider error / not-found screens.

On this page