UI.MD

Stepper

A multi-step progress indicator that shows completed, current, and upcoming steps.

Installation

$
npx shadcn@latest add https://ui.mattdowney.com/r/stepper.json

Usage

import {
  Stepper,
  StepperItem,
  StepperIndicator,
  StepperTitle,
  StepperDescription,
} from "@/components/ui/stepper"

Examples

Default

value is the step in progress: earlier steps complete (filled check), the current step is ringed, later steps stay muted. Steps are numbered automatically by position.

  1. Completed:
  2. Current step:
  3. Upcoming step:
  4. Upcoming step:

Vertical

Set orientation="vertical" for a left rail that runs alongside each step. This layout fits step descriptions.

  1. Completed:
    Create account
    Your email and a password.
  2. Current step:
    Verify email
    Confirm the link we sent you.
  3. Upcoming step:
    Build your profile
    Add a name and an avatar.

Interactive

Drive value from state to advance the flow. Pass a value past the last step to mark every step complete.

  1. Current step:
  2. Upcoming step:
  3. Upcoming step:
  4. Upcoming step:
Step 1 of 4

API Reference

PropTypeDefaultDescription
valueSteppernumber-The 1-based step currently in progress. Steps before it read as completed, steps after it as upcoming. Pass a number past the last step to mark the flow finished.
orientationStepper"horizontal" | "vertical""horizontal"Layout axis. Horizontal places labels beneath evenly-spaced indicators; vertical runs a left rail beside each step and suits descriptions.
childrenStepperItem, StepperIndicatorReactNode-On <StepperItem />, the first child is treated as the <StepperIndicator /> and everything after it is label content (<StepperTitle />, <StepperDescription />). On <StepperIndicator />, optional custom content for incomplete steps (defaults to the step number; completed steps always show a check).