Stepper
Show where a person is in a multi-step flow and what is done.
npx shadcn@latest add @silicon-ui/stepperInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/stepperManually
Install the dependencies
npm install motionCopy these files into your project
- components/silicon-ui/stepper/stepper.tsx
- components/silicon-ui/stepper/stepper.module.css
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
| Prop | Type | Default |
|---|---|---|
steps* | StepperStep[] | — |
current*Index of the step in progress. `steps.length` marks the whole flow complete. | number | — |
orientation | StepperOrientation
| "horizontal" |
onStepSelectCalled with the index of a completed step when it is chosen. Without it the stepper is a read-only indicator. | (index: number) => void | — |
details`current` shows only the active step's description, for tight spaces. Errors always show. | "all" | "current" | "all" |
compactMarkers only; labels stay available to assistive tech. Horizontal steppers switch to this below 30rem on their own and show the current step's label underneath. | boolean | false |
labelAccessible name for the stepper. | string | "Progress" |
completeLabelAnnounced, and shown in the compact caption, once every step is complete. | string | "All steps complete" |
className | string | — |
Dependencies
- npm
- motion
- Registry
- silicon-motion-tokens