cnippet/ui
  1. ui
  2. navigation
  3. stepper

navigation

Stepper

Shows progress through a multi-step flow such as checkout or onboarding, with completed, active and upcoming steps. Copy-paste ready.

Installation

Usage

Anatomy

Good to know

  • Steps start at 1. Every step before value shows as completed, value is active, and later steps are upcoming. Use completed on a StepperItem to mark a step done out of order.
  • The active item gets aria-current="step", so screen readers announce where the user is.
  • StepperTrigger is optional. Leave it out (as in the compact example) when users shouldn't click between steps, and use disabled on an item to block steps they haven't reached yet.
  • The stepper only shows progress. Render each step's content yourself, based on the same value.
  • Style by state with group-data-[state=completed]/step: and friends, since every part sits inside a group/step item.

API Reference

Stepper

StepperItem

StepperIndicator

Shows the step number, or a check when completed. Pass children to show something else, such as an icon.

Examples

Vertical

An onboarding checklist with titles and descriptions stacked down the side.

Compact

Dots without triggers, with the current step's name and a count above.

Revisiting finished steps

Steps the user has finished stay clickable after they go back; later steps stay disabled.