Skip to content
Haze UI

Stepper

Ordered list of named steps with check marks for finished ones, a ringed current step and connecting lines.

pnpm dlx shadcn@latest add @haze/stepper
Open preview in a new tab
Livesmall script

When to use

  • Checkout, onboarding or setup flows with a fixed number of named steps
  • Showing the reader how far along they are and what is left
  • Horizontal on wide screens that must stack vertically on a phone

When not to use

  • A single percentage; use progress
  • Steps the reader can open in any order; use tabs

Installation

Add the Haze registry to components.json once, then install Stepper with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/stepper
First time? Registry and theme setup

1. Add to components.json:

{
  "registries": {
    "@haze": "http://localhost:4329/r/{name}.json"
  }
}

2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";

API reference

PropTypeDefaultDescription
steps*{ title: string; description?: string }[]–Steps in order, each with a title and an optional one-line description.
current*number–0-based index of the current step; earlier steps are complete.
orientation"horizontal" | "vertical""horizontal"Horizontal rows up from sm; below sm both orientations stack.
labelstring"Progress"Accessible name of the list.
completedLabelstring"Completed"Screen-reader text placed before the title of a finished step; a colon is added. Translate it together with label.
classstring–Extra classes on the list.

Accessibility

  • The current step has aria-current="step"; finished steps start with hidden text (completedLabel, "Completed: " by default) so the check icon is not the only signal.
  • Step numbers and check icons are aria-hidden; the title text is what is read out.
  • The list has role="list" so Safari keeps its list semantics.
  • In forced-colors mode backgrounds vanish, so each marker gets a border: thick for the current step, medium with a check for finished steps and dashed for upcoming ones.
  • It is a plain ordered list of text, not a set of buttons, so it reports progress but does not navigate.

Notes for AI

Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.

  • Install and use

    Install the Haze UI component "Stepper" with `npx shadcn@latest add @haze/stepper`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Stepper from "@/components/haze/ui/stepper.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/ui/stepper.md

  • Customize with real content

    Adapt the Haze stepper ui for our product. Replace the demo values of these props with our real content: steps, current, orientation, label, completedLabel, class. Keep the layout, the heading level rules and these accessibility details: The current step has aria-current="step"; finished steps start with hidden text (completedLabel, "Completed: " by default) so the check icon is not the only signal. Step numbers and check icons are aria-hidden; the title text is what is read out. The list has role="list" so Safari keeps its list semantics. In forced-colors mode backgrounds vanish, so each marker gets a border: thick for the current step, medium with a check for finished steps and dashed for upcoming ones. It is a plain ordered list of text, not a set of buttons, so it reports progress but does not navigate. Do not add raw color classes; use the Haze tokens.

  • Choose the right block

    Before using stepper, check it fits: use it when checkout, onboarding or setup flows with a fixed number of named steps; showing the reader how far along they are and what is left; horizontal on wide screens that must stack vertically on a phone. Avoid it when a single percentage; use progress; steps the reader can open in any order; use tabs. Alternatives: @haze/progress, @haze/tabs, @haze/breadcrumb, @haze/timeline.

Dependencies

  • npm: @lucide/astro
  • @haze/utils
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog