Xzero UI
Pro library

Sign up form

An account creation flow with field validation, password strength, and a clear completion state.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/signup-form
Live · keyboard ready

Variant: Sign up

An account creation flow with field validation, password strength, and a clear completion state.

Use this as the client side of an account flow. Supply an onSubmit handler that creates the account and handles server errors.

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/signup-form

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 { SignupForm, type SignupDetails } from "@/components/xzero/blocks/signup-form/signup-form";

export function SignUpPage() {
  const [error, setError] = useState<string | null>(null);
  async function create(details: SignupDetails) {
    const res = await fetch("/api/sign-up", { method: "POST", body: JSON.stringify(details) });
    if (!res.ok) setError("That email is already registered.");
  }
  return <SignupForm onSubmit={create} serverError={error} onProvider={provider => signIn(provider.toLowerCase())} />;
}

API reference

SignupForm

An account creation card: Google, Apple, and GitHub buttons, then name, email, password with strength, a product updates opt-in, and a completion state whose check draws itself in.

PropTypeDefaultDescription
onSubmit(details: SignupDetails) => void | Promise<void>–Called with valid details. Awaited; a thrown error shows a submit error.
serverErrorstring | null–External error message shown under the form, for example from your auth API.
onProvider(provider: "Google" | "Apple" | "GitHub") => void–Called when a provider button is pressed. Start your OAuth redirect here. Without a redirect, the block simulates the provider and shows the completion state after 900ms.

SignupDetails

Type passed to onSubmit.

PropTypeDefaultDescription
name (required)string–Full name, at least 2 characters.
email (required)string–Email that passed a basic format check.
password (required)string–Password of 8 or more characters.
productUpdates (required)boolean–Opt-in checkbox state.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Related

Guidance for AI tools

Blocks are complete, self-contained screens with sample data. Replace the sample data and connect the callbacks described above. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components