Skip to main content
  1. Docs
  2. Components
  3. Navigation

Steps

Where a person is in a setup of a few steps: done, current and to come.

Import
@qeetrix/react/experimental
Status
ExperimentalSince 0.0.6
Renders
<ol>Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

Import

steps.tsx
// Experimental: from the package's experimental entry, until it's stable.
import { Steps } from "@qeetrix/react/experimental";

02

Props

And every native attribute of the element it renders.

PropTypeDefaultWhat it does
steps{ label, description?, status? }[]requiredThe steps in order; description shows in the vertical layout; status overrides current's state for one step.
currentnumberrequiredThe current step's index, from 0; steps.length once all are done.
orientation"horizontal" | "vertical""horizontal"Horizontal for a short wizard; vertical, with descriptions, for a longer setup.
onStepSelect(index) => void—Done steps become buttons back to themselves. Without it, steps are text.
messagesobjectthe provider'sThe list's name, "Completed" and "Not started".

03

Parts

Each part carries a data-slot, for tests and placement.

data-slotElementWhat it is
steps<ol>Named "Progress"; data-orientation.
step<li>data-state: done, current or upcoming.
step-marker<span>The tick or the number, aria-hidden.

04

With a form per step

Keep current in state; Continue moves on once the step's fields are valid, and Back or a done step goes back.

add-application.tsx
const [current, setCurrent] = useState(0);

<Steps steps={steps} current={current} onStepSelect={setCurrent} />
<Form onFormSubmit={() => setCurrent(current + 1)}>…</Form>
Next — StepsAccessibility