Skip to Content
Puzzle

Stepper

Show progress through a sequence of steps.

Stepper shows progress through a sequence. It does not render panels or validate a form: your application owns the content and the rules for advancing.

Import

import { Stepper } from "@puzzle-ui/ui";

Basic usage

Compose direct Stepper.Step children. Steps before the active step are completed automatically. Stable IDs preserve selection when steps are reordered; every step needs a unique ID in ID-based mode, and the active ID must match an available step.

390 × 240

Orientation and supporting text

orientation accepts "horizontal", "vertical", or a responsive object. Use description for supporting text and optional to identify a non-required step. Change device sizes to see the layout switch.

390 × 420

Clickable and non-linear steps

clickable turns selectable steps into buttons. By default, linear allows only the current and earlier steps to be selected. Set linear={false} to allow navigation to future steps; disabled still prevents selection.

390 × 340

Completed, error, and custom icons

completed overrides automatic completion. error takes precedence over other visual states. icon replaces the numeric or state indicator; keep the visible label meaningful because the indicator is hidden from assistive technology.

390 × 380

Controlled progress

Use activeStep with onStepChange for zero-based index selection. An external Continue action can advance progress while clickable steps allow returning to completed work. ID-based controlled selection uses activeStepId with onStepIdChange instead; do not mix the two modes.

390 × 360

API

Stepper

PropTypeDefaultDescription
childrenReactNodeRequiredDirect Stepper.Step children.
activeStepnumber-Controlled zero-based index, clamped to available steps.
defaultActiveStepnumber0Initial uncontrolled index.
onStepChange(step: number) => void-Next index after user selection, including in ID mode.
activeStepIdstring | number-Controlled stable ID; must match an available step.
defaultActiveStepIdstring | number-Initial uncontrolled stable ID.
onStepIdChange(stepId: string | number) => void-Next ID after selection in ID mode.
orientationResponsiveValue<"horizontal" | "vertical">"horizontal"Layout direction; responsive keys are mobile, tablet, and desktop.
clickablebooleanfalseRenders step buttons for navigation.
linearbooleantruePrevents selecting steps ahead of the active one.
classNamestring-Additional class on the root ordered list.
dir"ltr" | "rtl" | "auto"-Root direction; explicit rtl reverses horizontal keyboard navigation.

Other native ordered-list attributes are forwarded to the root.

Stepper.Step

PropTypeDefaultDescription
idstring | number-Stable identifier; required on every step in ID mode.
labelReactNodeRequiredVisible step label.
descriptionReactNode-Supporting text beneath the label.
optionalReactNode-Additional optional-step text.
iconReactNode-Custom indicator content.
completedbooleanBefore active stepOverrides automatic completion.
errorbooleanfalseDisplays an error state.
disabledbooleanfalsePrevents navigation to this step.
classNamestring-Additional class on the step list item.

Accessibility

Clickable steps use roving focus: arrow keys move focus (in either orientation), Home and End move to the first and last selectable step, and Enter or Space activates the focused step. With the default linear behavior, steps ahead of the active step cannot be selected.

The active list item exposes aria-current="step". Give the ordered list a descriptive aria-label when there are multiple progress indicators.

;