Skip to content
Zuno UI
Explore components
EXPLORE
Actions
Forms
Layout
Navigation
Data display
Feedback
Overlays
RESOURCES
Components/Stepper

Stepper

Progress through a multi-step flow; the steps a user may revisit depend on your validation.

Installation

Run it from the root of a project already set up with zunoui init.

npx zunoui@latest add stepper

Dependencies

What add stepper installs alongside the component. The CLI skips any you already have in a compatible version.

ZUNO registry

  • @zuno/utils

Examples

2 examples · 1 component
stepper

A checkout flow

Continue moves forward; completed steps can be revisited.

stepper

Vertical with an error

A step that failed validation is marked in color and in words.

API reference

Configured through props: pass the steps and the current one; which steps can be visited is decided by your validation.

PropTypeDefault
steps

The stages in order. error marks one that needs attention, in its color and in words.

{ id; label; description?; error? }[]—
current

The id of the step being shown.

string—
onStepChange

Called when a visitable step is chosen. Without it, every step is text.

(id: string) => void—
canVisit

Which steps are buttons. Use it to allow jumping ahead once your validation passes.

(step, index) => booleancompleted steps
orientation

Horizontal wraps on narrow screens; vertical suits a sidebar.

"horizontal" | "vertical""horizontal"
stepLabel / labels

Visible step numbers and the hidden state words, for translation.

(position) => ReactNode / { completed; error }"Step 1" / "Completed", "Needs attention"

States

The states that apply to this component and their visual treatment.

StateTreatment
CompleteA primary bar; a button when visitable.
CurrentA primary bar and aria-current="step".
UpcomingA neutral bar and dimmed text.
ErrorA red bar and "Needs attention" for screen readers.

Accessibility

A nav landmark ("Progress") with an ordered list, so the number of steps and each position are announced.

The current step carries aria-current="step". Completed and erroneous steps start with hidden text ("Completed:", "Needs attention:"), so the state is not conveyed by color alone.

Only visitable steps are buttons; the current and upcoming ones are text, so Tab only lands on steps that can be opened.

Moving between steps changes the form below: move focus to its heading after onStepChange so keyboard users land on the new content.

Validation stays in your form; the stepper only reflects it through canVisit and error.