Stepper
- Dates, Completed
- Guests, Current step
- Payment, Upcoming
- Done, Upcoming
npx shadcn add @klarhimmel/stepperCopy for AIExamples
Basic
Descriptions
Narrow
DetailsAbout, usage, props and more
Where someone is in a flow: numbered steps, the current one marked, each step's state said in words.
When to use
Use for
Showing progress through checkout, booking or onboarding.
Not for
A percentage. Use Progress. Switching between views. Use Tabs.
Pairs with
Button, Progress, a heading per step.
Preview
- Dates, Completed
- Guests, Current step
- Payment, Upcoming
- Done, Upcoming
Import
Import
- Files
- stepper.tsx, in components/klarhimmel/ui/. With it: theme, utils. npm: lucide-react.
- Render in
- Render it inside <Theme>, once near the root of your app. Tokens and fonts are scoped to it, so outside it the component is unstyled.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
steps | StepperStep[] | required | Required, in order. |
current | number | required | The step the person is on, counting from 0. Steps before it are complete; steps after it are upcoming. |
aria-label | string | required | Names the list. Required: "Booking progress". |
labels | { complete: string; current: string; upcoming: string } | { complete: 'Completed', current:… | What assistive tech hears beside each step, so state is never colour alone. Pass them translated. |
onStepSelect | (index: number) => void | - | With this, a completed step is a button that goes back to it. |
className | string | - | Extra classes, merged after the component's own. |
Accessibility
| Key | Does |
|---|---|
Tab | Reaches completed steps when onStepSelect is given |
Enter / Space | Goes back to the focused completed step |
An ordered list; the current step is aria-current="step" and every step says its state in words, so state is never colour alone.
Accessibility