Xzero UI
Pro library

Multi-step formPro

A guided form that presents one decision at a time and preserves progress.

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

Use it when a form needs distinct steps. Keep the number of steps small and provide a clear completion action.

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-pro/multi-step-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 { MultiStepForm } from "@/components/xzero/multi-step-form/multi-step-form";

export function Onboarding() {
  return (
    <MultiStepForm
      steps={[
        { id: "account", title: "Account", content: <AccountFields /> },
        { id: "team", title: "Team", description: "Who will you work with?", content: <TeamFields /> },
        { id: "plan", title: "Plan", content: <PlanFields /> },
      ]}
      onComplete={saveOnboarding}
    />
  );
}

API reference

MultiStepForm

A wizard that shows one fieldset per step with a progress list, Back and Continue actions, and a success state after the last step.

PropTypeDefaultDescription
steps (required)FormStep[]–Steps in order. Renders nothing when empty.
onComplete() => void–Called when the last step is submitted.
nextLabelstring"Continue"Submit label on every step except the last.
completeLabelstring"Finish"Submit label on the last step.
initialStepnumber0Zero-based starting step, clamped to the range.

FormStep

Step type: { id: string; title: string; description?: string; content: ReactNode }. title becomes the fieldset legend and the progress label.

No props.

Keyboard interactions

KeysAction
EnterSubmits the step (native form submit), advancing or finishing.
TabMoves through step fields and the Back and Continue buttons.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

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