Components
Step Progress
Numbered steps with the current one highlighted.
- Cart
- Address
- Payment
- Done
<StepProgress steps={["Cart", "Address", "Payment", "Done"]} current={1} />Installation
npx shadcn@latest add https://ui.zjkm.tech/r/step-progress.jsonimport { StepProgress } from "@/components/step-progress"Using JavaScript? Set tsx: false in components.json and the CLI converts it.
New to shadcn? Run npx shadcn@latest init first. The CLI needs components.json and the @/ import alias.
Usage
Numbered steps for a checkout or setup flow. Done steps get a tick, the current one is highlighted and marked with aria-current="step", and the line between them fills in.
import { StepProgress } from "@/components/step-progress";
export function Checkout({ step }: { step: number }) {
return <StepProgress label="Checkout" steps={["Cart", "Address", "Payment", "Done"]} current={step} />;
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
steps | string[] | The step names. | |
current | number | The step in progress, from 0. | |
label | string | "Progress" | Accessible name of the list. |
color | string | "#6366f1" | Colour of done and current steps. |
className | string | Classes for the list. |
With reduced motion, steps change without transitions.