Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Stepper

ProNew

Progress through a fixed sequence, horizontal or vertical, with drawn checks and lines that fill between steps.

Installation

pnpm dlx shadcn@latest add @viewport/stepper

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
steps*Step[]—
current*number

The index of the step in progress, from 0. Pass `steps.length` when every step is done.

—
onStepClick(index: number) => void

Lets the user go back: completed steps become buttons that call this with their index.

—
orientation"horizontal" | "vertical""horizontal"
labelstring

Accessible name for the list, e.g. "Checkout progress".

"Progress"
classNamestring—

Accessibility

  • An ordered list; the current step has aria-current and each step states its status.
  • Completed steps can be buttons for going back.
  • On narrow screens every marker stays and only the current title is shown.
  • Respects prefers-reduced-motion.