Xzero UI
Pro library

Stepper

Show where a person is in a multi-step flow and what is done.

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

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/stepper

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 { Stepper } from "@/components/xzero/stepper/stepper";

export function CheckoutSteps({ step, goTo }: { step: number; goTo: (index: number) => void }) {
  return (
    <Stepper
      current={step}
      onStepSelect={goTo}
      steps={[
        { id: "cart", label: "Cart" },
        { id: "shipping", label: "Shipping", description: "Address and delivery" },
        { id: "payment", label: "Payment" },
      ]}
    />
  );
}

API reference

Stepper

A horizontal or vertical steps indicator driven by the current index, with optional navigation back to completed steps.

PropTypeDefaultDescription
steps (required){ id: string; label: string; description?: string; error?: string }[]–Steps in order. error morphs the marker into an alert and replaces the description.
current (required)number–Index of the step in progress. steps.length marks the flow complete.
orientation"horizontal" | "vertical""horizontal"Layout direction.
onStepSelect(index: number) => void–Called with the index of a completed step when chosen. Without it the stepper is read only.
details"all" | "current""all""current" shows only the active step's description. Errors always show.
compactbooleanfalseMarkers only. Horizontal steppers switch to this below 30rem on their own.
labelstring"Progress"Accessible name for the stepper.
completeLabelstring"All steps complete"Announced, and shown in the compact caption, once every step is complete.
classNamestring–Class on the root.

Keyboard interactions

KeysAction
ArrowLeft / ArrowRight / ArrowUp / ArrowDownWith onStepSelect, moves focus between reachable steps (RTL aware).
Home / EndJumps to the first or the current step.
Enter / SpaceSelects a completed step.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in progress

Guidance for AI tools

Stepper: Show where a person is in a multi-step flow and what is done. 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