Stepper
The steps of a flow that is done in order: a checkout, a setup, an import. It shows which steps are done, which one is current and which are still to come, and can mark a step that failed. For views a reader may open in any order, use tabs.
Install
npx shadcn@latest add @thrum-pro/stepperThis is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.
Automatically installs icon check from the icon set.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
Stepper: value | number | – | The position of the current step, counted from 0, when the parent holds it. Steps before it are complete. A value equal to the number of steps completes them all. |
Stepper: defaultValue | number | Default 0 | The current step at first, when the stepper holds it itself. |
Stepper: onValueChange | (value: number) => void | – | Called with a step's position when the reader presses a completed step. Only a clickable stepper calls it. |
Stepper: orientation | "horizontal" | "vertical" | Default "horizontal" | horizontal puts the steps side by side with their titles underneath. vertical stacks them with their titles beside them, which suits long titles and narrow containers. |
Stepper: clickable | boolean | Default false | Make every completed step a button that goes back to it. The current step and later ones stay plain text. |
Stepper: sound | boolean | Default true | Play a tick when the reader goes back to a step, if the visitor has sound on. |
Stepper: className | string | – | Extra classes for the list, merged last. It fills the width it is given. |
Stepper: ...props | ComponentProps<"ol"> | – | Every other attribute of the list. Give it an aria-label. |
StepperItem: title | ReactNode | Required | The step's name. |
StepperItem: description | ReactNode | – | A line under the title, in the muted text colour. |
StepperItem: error | boolean | Default false | The step failed or needs a correction. It shows a warning mark in the destructive colour in place of its number or tick. |
StepperItem: className | string | – | Extra classes for the step's list item. |
Motion and sound
Motion
- The line between two steps fills from the earlier step to the later one over 200 ms when the earlier one is completed, and empties the same way when the reader goes back.
- A marker's fill, border and number change colour over 150 ms.
- Reduced motion: lines and markers change at once.
Sound
- A tick when the reader presses a completed step to go back to it. A change made by the parent, such as a Next button, is silent.
Sound is off until the visitor turns it on. Pass sound={false} to keep this component silent. How sound works
Accessibility
- It is an ordered list, so a screen reader announces the number of steps and each step's position. Name it with an aria-label.
- The current step carries aria-current="step". A completed step ends with the hidden word completed and a failed one with error.
- Each state has its own mark: a tick on a filled marker, a number in a ring, a number in a faint ring, or a warning mark. Colour is never the only sign.
- In a clickable stepper a completed step is a native button, at least 28 pixels tall, named by its title, its description and the word completed.
- Titles and descriptions wrap. In a container under about 320 pixels, use the vertical orientation: side by side, four titles have too little room to read well.
| Keys | Action |
|---|---|
| Tab | In a clickable stepper: move through the completed steps. The other steps are text and are skipped. |
| Enter / Space | Go back to the focused step. |
Source
The source comes with Pro
TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies
Files and dependencies
- Adds
components/ui/stepper.tsx- Packages
- None
- Brings along
- Sound engine
- Icons
check
Changelog
- 1.0.0 · 2026-12-03First release.