Stepper
Ordered-list progress indicator for multi-step flows.
import { Stepper } from '@elirobinson/react/components/molecules/Stepper';Styles: @elirobinson/react/styles/molecules/Stepper.css — already included when you import @elirobinson/react/styles.css.
- ✓Cart
- 2Shipping
- 3Payment
- 4Review
Show code
import { Stepper } from '@elirobinson/react/components/molecules/Stepper';
const steps = [{ label: 'Cart' }, { label: 'Shipping' }, { label: 'Payment' }, { label: 'Review' }];
export default function Basic() {
return <Stepper steps={steps} activeStep={2} />;
}When to use it
Use Stepper to show progress through a fixed, linear, multi-step flow — checkout,
onboarding, a multi-page form. activeStep is 1-indexed: a step is complete when its
number is below activeStep, active when it equals activeStep, and upcoming
otherwise. It's a display component only — it doesn't make steps clickable and it
doesn't manage which step you're on; your flow's own state drives activeStep.
For a continuous percentage rather than discrete named steps, use Progress instead.
Through a flow
- 1Account
- 2Studio details
- 3Invite clients
- ✓Account
- 2Studio details
- 3Invite clients
- ✓Account
- ✓Studio details
- 3Invite clients
Show code
import { Stepper } from '@elirobinson/react/components/molecules/Stepper';
const steps = [{ label: 'Account' }, { label: 'Studio details' }, { label: 'Invite clients' }];
export default function Progress() {
return (
<div className="demo-col">
<Stepper steps={steps} activeStep={1} />
<Stepper steps={steps} activeStep={2} />
<Stepper steps={steps} activeStep={3} />
</div>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
activeSteprequired | number | — | — |
stepsrequired | StepperStep[] | — | — |
Also accepts all HTMLAttributes<HTMLOListElement> props.
Accessibility
- Renders a native
<ol>with one<li>per step — the ordered list itself conveys sequence, independent of any visual styling. - The active step's
<li>getsaria-current="step". - The step indicator (a number or a
✓for completed steps) is not hidden from screen readers — it's announced along with the label, so a completed step reads as something like "check mark, Account" rather than silently showing just "Account." - Keyboard: none —
Stepperrenders no interactive elements, so there's nothing to tab to. If you need clickable steps (jump back to a previous one), you'll need to build that affordance yourself; the component doesn't invent it. - The ref forwards to the outer
<ol>.
Do
- Keep step labels to one or two words — "Payment," not "Enter your payment details."
- Drive activeStep from the same state that controls which step's content is rendered.
- Use it for a flow with a small, fixed number of steps known up front.
- Reset or preserve step state deliberately when a user navigates away and back.
Don't
- Expect Stepper to make steps clickable — it's a progress display, not navigation.
- Use 0-indexed step numbers — activeStep counts from 1.
- Use Stepper for an open-ended or branching flow; it assumes a fixed linear sequence.
- Reach for Stepper when a simple percentage is all you need — that's Progress.