Xzero UI
Pro library

Centered login

A passkey-first login card on a quiet ring backdrop that morphs through email and code.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/login-centered
Live · keyboard ready

Variant: Centered

A passkey-first login card on a quiet ring backdrop that morphs through email and code.

Use this as a full screen sign in page (pass fullScreen). Connect the passkey button to WebAuthn, the email step to your magic code sender, the code step to verification, and the SSO buttons to your OAuth routes; onSignIn receives the email, method and mode.

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/login-centered

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { LoginCentered } from "@/components/xzero/blocks/login-centered/login-centered";
import { useRouter } from "next/navigation";

export default function SignInPage() {
  const router = useRouter();
  return (
    <LoginCentered
      fullScreen
      termsHref="/terms"
      privacyHref="/privacy"
      onSignIn={() => router.push("/app")}
    />
  );
}

Examples

Route sign ups to onboarding

<LoginCentered
  fullScreen
  onSignIn={(email, method, mode) =>
    router.push(mode === "sign-up" ? "/welcome" : "/app")
  }
/>

API reference

LoginCentered

A passkey-first sign in and sign up card on a ring backdrop that morphs through email and a six digit code. Passkey, email delivery and SSO are simulated.

PropTypeDefaultDescription
fullScreenbooleanfalseFill the viewport (100dvh, no frame) when the block is the whole page.
onSignIn(email: string, method: LoginMethod, mode: "sign-in" | "sign-up") => void–Called once the simulated sign in or sign up succeeds. LoginMethod is "Passkey" | "Email code" | "Google" | "Apple" | "GitHub".
demoCodestring"482913"The code the simulated email contains.
demoEmailstring"maya@northwind.studio"The account a simulated passkey or single sign-on resolves to.
termsHrefstring"#terms"Terms link in the footer.
privacyHrefstring"#privacy"Privacy link in the footer.
classNamestring–Appended to the root element.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Related

Browse all components