Skip to Content
zjkm-ui
Components

Step Progress

Numbered steps with the current one highlighted.

  1. Cart(done)
  2. Address
  3. Payment
  4. Done
Props
1
<StepProgress steps={["Cart", "Address", "Payment", "Done"]} current={1} />

Installation

npx shadcn@latest add https://ui.zjkm.tech/r/step-progress.json
import { 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

PropTypeDefaultDescription
stepsstring[]The step names.
currentnumberThe step in progress, from 0.
labelstring"Progress"Accessible name of the list.
colorstring"#6366f1"Colour of done and current steps.
classNamestringClasses for the list.

With reduced motion, steps change without transitions.

On this page