Stepper
ProNewProgress through a fixed sequence, horizontal or vertical, with drawn checks and lines that fill between steps.
Installation
pnpm dlx shadcn@latest add @viewport/stepper
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| steps* | Step[] | — |
| current* | numberThe index of the step in progress, from 0. Pass `steps.length` when every step is done. | — |
| onStepClick | (index: number) => voidLets the user go back: completed steps become buttons that call this with their index. | — |
| orientation | "horizontal" | "vertical" | "horizontal" |
| label | stringAccessible name for the list, e.g. "Checkout progress". | "Progress" |
| className | string | — |
Accessibility
- An ordered list; the current step has aria-current and each step states its status.
- Completed steps can be buttons for going back.
- On narrow screens every marker stays and only the current title is shown.
- Respects prefers-reduced-motion.