Progress Stepper
ProgressStepper shows the current stage of a sequential workflow.
import { ProgressStepper } from '@/components/ui/wideset/progress-stepper/ProgressStepper';
<ProgressStepper
steps={[
{ title: 'Account', caption: 'Your details' },
{ title: 'Billing', caption: 'Plan and card' },
{ title: 'Review', caption: 'Confirm and pay' },
]}
activeStep={1}
/>Installation
pnpm dlx wideset add progress-stepper
Copies the component and any Wideset components it uses into your project.
Examples
Orientation
Horizontal goes above a form that takes the full width, with three to five short step titles. Vertical goes in a side column next to the form and fits more steps or longer captions. Both are an ordered list, so screen readers announce the step count.
import { ProgressStepper } from '@/components/ui/wideset/progress-stepper/ProgressStepper';
const steps = [
{ title: 'Account', caption: 'Your details' },
{ title: 'Billing', caption: 'Plan and card' },
{ title: 'Review', caption: 'Confirm and pay' },
];
export default function ProgressStepperOrientation() {
return (
<div className="gap-ws-16 flex flex-col items-center">
<div className="gap-ws-7 flex flex-col items-center">
<span className="typography-caption-md text-ws-static-subtle">Horizontal</span>
<ProgressStepper orientation="horizontal" steps={steps} activeStep={1} />
</div>
<div className="gap-ws-7 flex flex-col items-center">
<span className="typography-caption-md text-ws-static-subtle">Vertical</span>
<ProgressStepper orientation="vertical" steps={steps} activeStep={1} />
</div>
</div>
);
}Statuses
activeStep sets the statuses for you: steps before it are completed, the step itself is active, the rest are incomplete and cannot be clicked until allStepsClickable is on. Set status: 'error' on a step to flag a problem the user has to go back and fix; it overrides the computed status. Screen readers hear the active step through aria-current="step".
import { ProgressStepper } from '@/components/ui/wideset/progress-stepper/ProgressStepper';
export default function ProgressStepperStatuses() {
return (
<div className="gap-ws-11 flex flex-col items-center">
<div className="w-[34rem] max-w-full">
<ProgressStepper
steps={[
{ title: 'Account' },
{ title: 'Billing' },
{ title: 'Shipping' },
{ title: 'Review' },
]}
activeStep={2}
/>
</div>
<div className="w-[34rem] max-w-full">
<ProgressStepper
steps={[
{ title: 'Account' },
{ title: 'Billing', status: 'error' },
{ title: 'Shipping' },
{ title: 'Review' },
]}
activeStep={2}
/>
</div>
</div>
);
}API reference
ProgressStepper
| Name | Description | Default |
|---|---|---|
activeStep | The 0-based index of the currently active step. Steps before this index are marked completed, steps after are incomplete. Set to the length of `steps` to mark all steps complete. number | 0 |
allStepsClickable | When `true`, future steps are also clickable, not just past and active steps. boolean | — |
children | Compose steps manually using `ProgressStepper.Step`. Takes precedence over `steps`. ReactNode | — |
disabled | Disables all step interactions. boolean | — |
onStepChange | Called with the 0-based step index when the user clicks a step. ((step: number) => void) | — |
orientation | Layout direction of the stepper. ProgressStepperOrientation | 'horizontal' |
steps | Array-driven step definitions. Each entry requires a `title`, optionally a `caption`, and optionally a `status` to override the computed state. Mutually exclusive with `children`. { title: string; caption?: string | undefined; status?: 'error' | 'completed' | 'incomplete' | 'active' | undefined; }[] | — |
<ol> is passed through to it. See MDN: <ol>.ProgressStepper.Icon
| Name | Description | Default |
|---|---|---|
step* | Zero-based step index. number | — |
disabled | boolean | false |
interactive | Allows users to activate steps. boolean | — |
onClick | Called with the zero-based step index when the step is activated. ((step: number) => void) | — |
orientation | Layout direction of the component. 'horizontal''vertical' | 'horizontal' |
status | 'error''completed''incomplete''active' | — |
stepAriaLabel | Accessible name of the icon button when `interactive`, from its zero-based step. Defaults to `Step 1`, `Step 2`, … ((step: number) => string) | — |
<div> is passed through to it. See MDN: <div>.ProgressStepper.Step
| Name | Description | Default |
|---|---|---|
orientation* | Layout direction of the component. ProgressStepperOrientation | 'horizontal' |
step* | Zero-based step index. number | — |
title* | Title displayed for this item. string | — |
caption | Supporting caption displayed below the title. string | — |
disabled | boolean | false |
onClick | Called with the zero-based step index when the step is activated. ((step: number) => void) | — |
status | 'error''completed''incomplete''active' | — |
<li> is passed through to it. See MDN: <li>.Accessibility
- Renders an ordered list, so the step count is announced; the active step has
aria-current="step". - An
errorstatus is visual; say what failed in the form itself.
| Part | Renders | Description |
|---|---|---|
| ProgressStepperRenders no element | <ol> | A sequence of named steps showing workflow progress. |
| ProgressStepper.IconRenders no element | <div> | An icon rendered within `ProgressStepper`. |
| ProgressStepper.StepRenders no element | <li> | An individual stage in the progress indicator. |
import { ProgressStepper } from '@/components/ui/wideset/progress-stepper/ProgressStepper';
<ProgressStepper
steps={[
{ title: 'Account', caption: 'Your details' },
{ title: 'Billing', caption: 'Plan and card' },
{ title: 'Review', caption: 'Confirm and pay' },
]}
activeStep={1}
/>