Stepper
A component that guides users through a multi-step process with clear visual progress indicators.
Installation
pnpm dlx shadcn@latest add @diceui/stepper
Layout
Import the parts, and compose them together.
import {
Stepper,
StepperList,
StepperItem,
StepperTrigger,
StepperIndicator,
StepperTitle,
StepperDescription,
StepperSeparator,
StepperContent,
StepperPrev,
StepperNext,
} from "@/components/ui/stepper";
return (
<Stepper>
<StepperList>
<StepperItem>
<StepperTrigger>
<StepperIndicator />
<StepperTitle />
<StepperDescription />
</StepperTrigger>
<StepperSeparator />
</StepperItem>
</StepperList>
<StepperContent />
<StepperPrev />
<StepperNext />
</Stepper>
)Examples
Vertical Layout
A stepper with vertical orientation for compact layouts.
With Validation
Use the onValidate prop to validate the current step before moving to the next one.
With Form
A stepper integrated with form validation, showing step-by-step form completion.
API Reference
Stepper
The main container component for the stepper.
Prop
Type
| Data Attribute | Value |
|---|---|
[data-orientation] | "horizontal" | "vertical" |
StepperList
The container for stepper items, typically an ordered list.
Prop
Type
| Data Attribute | Value |
|---|---|
[data-orientation] | "horizontal" | "vertical" |
StepperItem
A single step item in the stepper.
Prop
Type
| Data Attribute | Value |
|---|---|
[data-orientation] | "horizontal" | "vertical" |
[data-state] | "inactive" | "active" | "completed" |
StepperTrigger
The clickable trigger for each step, typically wrapping the indicator.
Prop
Type
| Data Attribute | Value |
|---|---|
[data-orientation] | "horizontal" | "vertical" |
[data-state] | "inactive" | "active" | "completed" |
StepperIndicator
The visual indicator showing the step number or completion status.
Prop
Type
| Data Attribute | Value |
|---|---|
[data-state] | "inactive" | "active" | "completed" |
StepperSeparator
The line connecting steps, showing progress between them.
Prop
Type
| Data Attribute | Value |
|---|---|
[data-orientation] | "horizontal" | "vertical" |
[data-state] | "inactive" | "active" | "completed" |
StepperTitle
The title text for each step.
Prop
Type
StepperDescription
The description text for each step.
Prop
Type
StepperContent
The content area that displays for the active step.
Prop
Type
StepperPrev
A navigation button that moves to the previous step. Automatically disabled on the first step and skips validation when navigating backwards.
Prop
Type
StepperNext
A navigation button that moves to the next step. Automatically disabled on the last step and respects validation rules when navigating forwards.
Prop
Type
Accessibility
Keyboard Interactions
| Key | Description |
|---|---|
| Tab | Moves focus to the next focusable element. |
| Shift + Tab | Moves focus to the previous focusable element. |
| EnterSpace | Activates the focused step when clickable is enabled. |
| ArrowLeftArrowUp | Moves focus to the previous step trigger. |
| ArrowRightArrowDown | Moves focus to the next step trigger. |
| Home | Moves focus to the first step trigger. |
| End | Moves focus to the last step trigger. |