Installation
npx sdaia-ui@latest add stepper
Usage
import { Stepper } from '@/components/ui/Stepper';
import { StepperItem } from '@/components/ui/StepperItem';1<Stepper currentStep={2} aria-label="Create a user">2<StepperItem title="Account" />3<StepperItem title="Details" />4<StepperItem title="Review" />5<StepperItem title="Done" />6</Stepper>
Examples
Default
Horizontal stepper above a form. currentStep sets every status from the step's position.
Loading demo: stepper-default
Vertical
Steps stacked in a column with the text beside them; fits a side panel.
Loading demo: stepper-vertical
Statuses
Completed, Current, Upcoming and Error. The connector turns green once the step before it is complete.
Loading demo: stepper-statuses
Error on a step
Mark the step that has a problem and say what is wrong in the description.
Loading demo: stepper-error
Approval workflow
Use the description to show the owner or date of each step.
Loading demo: stepper-approval
Arabic (RTL)
The order and alignment mirror for right-to-left.
Loading demo: stepper-rtl
Vertical, Arabic (RTL)
The vertical stepper mirrors too: the rail moves to the right.
Loading demo: stepper-vertical-rtl
When to use
Use the stepper for:
- Multi-step forms with three to six steps
- Approval and onboarding workflows
- Showing progress through a fixed sequence
- Letting users see what is left to do
Don't use it for:
- Navigating between unrelated pages: use Tabs
- Showing a percentage: use a Progress Bar
- Phone layouts: use the Radial Stepper
- Flows with more than seven steps: group them
Best practices
- Keep step titles to one or two words, such as Account, Details and Review.
- Choose the orientation for the space: horizontal above a form, vertical in a side panel.
- When a step has an error, use the Error status and say what is wrong in the description. Don't mark it Completed.
Props
Stepper
Prop | Type | Default | Required |
|---|---|---|---|
orientation | "horizontal" | "vertical" | "horizontal" | optional |
currentStep | number | — | optional |
children | StepperItem elements | — | optional |
dir | "ltr" | "rtl" | — | optional |
labels | { completed?: string; upcoming?: string; error?: string } | { completed: "Completed", upcoming: "Upcoming", error: "Error" } | optional |
aria-label | string | — | optional |
StepperItem
Prop | Type | Default | Required |
|---|---|---|---|
title | ReactNode | — | required |
description | ReactNode | — | optional |
status | "completed" | "current" | "upcoming" | "error" | "upcoming" | optional |
stepNumber | ReactNode | position | optional |
connector | boolean | true (false on the last step) | optional |
orientation | "horizontal" | "vertical" | from Stepper | optional |
labels | { completed?: string; upcoming?: string; error?: string } | from Stepper | optional |
Accessibility
- The stepper is an ordered list (ol); give it a name with aria-label.
- The current step has aria-current="step". Completed, upcoming and error steps add their status as visually hidden text, so it is not shown by the icon alone.
- Indicators and connectors are decorative and hidden from screen readers.
- The stepper is not interactive and adds no tab stops.
- Step circles and connectors are at least 3:1 against the page in light and dark.
Responsive behavior
- The horizontal stepper fills its container and shares the row equally between steps.
- When its container is narrower than 36rem (576 px), the horizontal stepper restacks into the vertical layout so titles never collide. On phones, consider the Radial Stepper.
- Spacing uses the brand spacing scale Figma binds, the same at every width; text sizes follow the responsive type tokens.