Docs
Stepper
Stepper
Shows progress through a sequence of steps.
1
Account Details
Create your account
2
Personal Information
Add your personal info
3
Review and Submit
Review your information
Fill in your account details to get started.
A stepper displays progress through a sequence of logical and numbered steps. They may also be used for navigation.
Examples
Horizontal (Default)
Vertical
1
Account Details
Create your account
Fill in your account details to get started.
2
Personal Information
Add your personal info
3
Review and Submit
Review your information
Installation
Usage
import { Stepper } from "@/components/ui/stepper";import {
Stepper,
Step,
StepIndicator,
StepLabel,
StepDescription,
StepContent,
} from "@/components/ui/stepper";
export function StepperExample() {
const [activeStep, setActiveStep] = React.useState(0);
return (
<Stepper activeStep={activeStep}>
<Step>
<StepIndicator>1</StepIndicator>
<div className="ml-3">
<StepLabel>Step 1</StepLabel>
<StepDescription>Description for step 1</StepDescription>
</div>
</Step>
<Step>
<StepIndicator>2</StepIndicator>
<div className="ml-3">
<StepLabel>Step 2</StepLabel>
<StepDescription>Description for step 2</StepDescription>
</div>
</Step>
<Step>
<StepIndicator>3</StepIndicator>
<div className="ml-3">
<StepLabel>Step 3</StepLabel>
<StepDescription>Description for step 3</StepDescription>
</div>
</Step>
</Stepper>
);
}Props
Stepper
| Prop | Type | Default | Description |
|---|---|---|---|
activeStep | number | required | The active step index (zero-based). |
orientation | horizontal | vertical | horizontal | The orientation of the stepper. |
className | string | - | The class name to apply to the component. |
children | ReactNode | - | The Step components to display. |
Step
| Prop | Type | Default | Description |
|---|---|---|---|
orientation | horizontal | vertical | horizontal | The orientation of the step (inherited from Stepper). |
isLast | boolean | - | Whether this is the last step (auto-set by Stepper). |
className | string | - | The class name to apply to the component. |
children | ReactNode | - | The content to display in the step. |
StepIndicator
| Prop | Type | Default | Description |
|---|---|---|---|
active | boolean | - | Whether this step is active (auto-set by Stepper). |
completed | boolean | - | Whether this step is completed (auto-set by Stepper). |
className | string | - | The class name to apply to the component. |
children | ReactNode | - | The content to display in the indicator. |
StepLabel
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | The class name to apply to the component. |
children | ReactNode | - | The content to display in the label. |
StepDescription
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | The class name to apply to the component. |
children | ReactNode | - | The content to display in the description. |
StepContent
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | The class name to apply to the component. |
children | ReactNode | - | The content to display in the step content. |