Horizontal Stepper
Compact horizontal progress stepper for CI bars, wizard headers, and breadcrumb-style progress. It is display-only: the active value derives completed, active, and pending step states.
Installation
dgadd is not public on npm yet. Until the first release, pack @diffgazer/add from the repository and install that tarball into this app, which is what puts dgadd on pnpm exec.
The hosted registry is not public yet because r.b4r7.dev does not resolve. Use this source checkout or a local registry preview until the endpoint returns 200.
Diffgazer packages are not yet published to npm. Until the first release, pack @diffgazer/ui and @diffgazer/keys from the repository and install those tarballs.
UI components require Tailwind CSS v4. Local copy mode imports src/styles/styles.css; package mode uses @diffgazer/ui CSS once packages are available.
Usage
Examples
Variants
Variant: ASCII (start, mid-run, done)
Compact / Constrained Width
Progress
API Reference
HorizontalStepper
HorizontalStepper.Step
Data attributes
Accessibility
Keyboard Navigation
HorizontalStepper is display-only. It renders list semantics and aria-current for the active step, but it does not own keyboard handlers.
Notes
Status Derivation
Rendered HorizontalStepper.Step children define order. Steps before value are completed, the matching step is active, and following steps are pending.
Variants
ascii renders inline bracket glyphs with text connectors, numbered renders a numbered indicator on a continuous line, and breadcrumb renders slash-separated labels. Completed indicators and connectors read the primary token, so progress stays monochrome in both themes; the status palette is reserved for meaning.
Glyph Hierarchy
ascii glyphs share the form family's grammar: the brackets render muted as chrome and the inner mark ([x], [~]) keeps the step's status tone at bold weight, so completed and active marks carry the contrast and a pending [ ] reads entirely as chrome. The visible text is unchanged.
Root Element
The root accepts the full ordered-list contract: id, data-*, ref, and any other <ol> attribute is spread onto the element, matching the vertical Stepper.
Constrained Containers
Steps and connectors never break internally, so a narrow parent cannot wrap a label mid-word or split the [ ] glyph across two lines. The root declares a container query instead, in three tiers. Below 36rem of inline space the stepper collapses to the compact treatment: connectors drop out, non-active labels leave the layout, and the active label is prefixed with "Step 3/6 ·". Narrower still, the glyph run becomes a viewfinder window — previous, active, next, plus muted "+2" / "+1" counters for the steps it elides — which makes the run a constant width for any step count. That window engages from need, not from a blanket width: the threshold is keyed by variant and step count, so a four-step ascii run keeps its full run down to 18rem while a twelve-step run windows from 32rem. Below 14rem only the active step remains, but its glyph never drops: the stepper always shows progress. Because every switch is a container query and not a viewport breakpoint, the same stepper adapts inside a sidebar, a dialog, and a full-width page without the consumer branching. Pass compact to force the first two tiers at any width; the narrowest still follows the container.
Accessibility
The root is an ordered list named by aria-label (default "Progress"). The active item exposes aria-current="step", and each item includes screen-reader status text: Completed, Current, or Upcoming. Every compact tier only collapses things visually — every step and its label stay in the accessibility tree at every width. The "Step 3/6 ·" prefix and the "+2" / "+1" elision counters are aria-hidden, because list position and the step statuses already carry that information.
Source
Install via CLI: pnpm exec dgadd add ui/horizontal-stepper.
Highlighted source loads after this disclosure opens. Browse the source repository.