Step Track
betaA compact horizontal stepper whose line fills to the active node, which swells, with previous and next buttons below.
- Navigation
- 1 file
- 1 npm package
- Accessibility notes
Loading the example…
pnpm dlx @dowel-ui/cli add step-tracknpm packages installed: class-variance-authority.
import { StepTrack } from "@/components/ui/step-track";Default
Demo
Labelled
<StepTrack>
| Prop | Type | Default |
|---|---|---|
defaultValueInitial active step when uncontrolled. | number | 0 |
hideControlsHides the ‹ › buttons, for a read-only progress track. | boolean | false |
nextLabelAccessible name of the next button. | string | "Next step" |
onValueChangeCalled with the new step when the buttons move it. | (value: number) => void | — |
previousLabelAccessible name of the previous button. | string | "Previous step" |
size | "sm" | "md" | "lg" | "md" |
stepsHow many steps, or a label for each. | number | readonly string[] | 4 |
valueControlled active step, zero-based. | number | — |
Plus every attribute of <div> except defaultValue, onChange, children.
A role="group" (named "Progress" unless aria-label is given) holding an ordered list whose active item has aria-current="step"; each node carries hidden text such as "Step 2 of 4: Shipping". The previous and next buttons are native buttons with accessible names, disabled at either end, with a visible focus ring. A polite, atomic live region announces the new step once per change. The line fills along the reading direction and the chevrons mirror in right-to-left layouts. Under reduced motion the line and nodes change without animating.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes