Stepper
NewA sequence of steps for a multi-part task.
Preview
Installation
npx sigma-ui@latest add stepperUsage
<script setup lang="ts">
import { Stepper, StepperIndicator, StepperItem, StepperTitle, StepperTrigger } from '@/components/ui/stepper';
</script>
<template>
<Stepper>
<StepperItem :step="1">
<StepperTrigger>
<StepperIndicator>1</StepperIndicator>
<StepperTitle>Account</StepperTitle>
</StepperTrigger>
</StepperItem>
</Stepper>
</template>Bind the active step with v-model. Set linear so a step can be opened only after the previous one is complete. orientation is horizontal or vertical.
StepperSeparator draws the line between steps. It turns into the accent color once the step is completed.
Examples
Horizontal
API Reference
Stepper
Props
| Prop | Type | Default |
|---|---|---|
defaultValueThe value of the step that should be active when initially rendered. Use when you do not need to control the state of the steps. | number | - |
orientationThe orientation the steps are laid out. Mainly so arrow navigation is done accordingly (left & right vs. up & down). | DataOrientation | horizontal |
dirThe reading direction of the combobox when applicable. <br> If omitted, inherits globally from | Direction | - |
modelValueThe controlled value of the step to activate. Can be bound as | number | - |
linearWhether or not the steps must be completed in order. | boolean | - |
asChildChange the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. | boolean | - |
asThe element or component this component should render as. Can be overwritten by | AsTag | Component | "div" |
Events
| Event | Payload |
|---|---|
update:modelValueEvent handler called when the value changes | [payload: number] |
Slots
| Slot | Scope |
|---|---|
default
| { modelValue?: number; } |
StepperDescription
Props
| Prop | Type | Default |
|---|---|---|
asChildChange the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. | boolean | - |
asThe element or component this component should render as. Can be overwritten by | AsTag | Component | "div" |
Slots
| Slot | Scope |
|---|---|
defaultShort explanation of the step. | - |
StepperIndicator
Props
| Prop | Type | Default |
|---|---|---|
asChildChange the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. | boolean | - |
asThe element or component this component should render as. Can be overwritten by | AsTag | Component | "div" |
Slots
| Slot | Scope |
|---|---|
defaultStep number or icon. Receives the current step index. | { step: number; } |
StepperItem
Props
| Prop | Type | Default |
|---|---|---|
steprequiredA unique value that associates the stepper item with an index | number | - |
disabledWhen | boolean | - |
completedShows whether the step is completed. | boolean | - |
asChildChange the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. | boolean | - |
asThe element or component this component should render as. Can be overwritten by | AsTag | Component | "div" |
Slots
| Slot | Scope |
|---|---|
defaultTrigger, indicator, title, and separator. Receives the step state. | { state: "active" | "inactive" | "completed"; } |
StepperSeparator
Props
| Prop | Type | Default |
|---|---|---|
orientationOrientation of the component. Either | DataOrientation | - |
decorativeWhether or not the component is purely decorative. <br>When | boolean | - |
asChildChange the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. | boolean | - |
asThe element or component this component should render as. Can be overwritten by | AsTag | Component | "div" |
StepperTitle
Props
| Prop | Type | Default |
|---|---|---|
asChildChange the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. | boolean | - |
asThe element or component this component should render as. Can be overwritten by | AsTag | Component | "div" |
Slots
| Slot | Scope |
|---|---|
defaultName of the step. | - |
StepperTrigger
Props
| Prop | Type | Default |
|---|---|---|
asChildChange the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. | boolean | - |
asThe element or component this component should render as. Can be overwritten by | AsTag | Component | "div" |
Slots
| Slot | Scope |
|---|---|
defaultIndicator and labels for one step. | - |
Accessibility
The stepper follows the tabs pattern for a sequence: each step is a button, and arrow keys move between steps.
| Key | Description |
|---|---|
| Tab | Moves focus into the stepper. |
| ArrowRight or ArrowDown | Moves to the next step. |
| ArrowLeft or ArrowUp | Moves to the previous step. |
| Enter or Space | Activates the focused step. |