Stepper

Shows where a person is in a multi-step flow. One compound with three variants: a vertical rail for long flows, a horizontal row for medium ones (often in a dialog), and a progress bar for short ones. "Step N of M" sits at the right end of the card's header row, and the card title names the step, so there is no step-name label above the title.

Spec · from metadata

When to use

  • •A multi-step wizard or flow with a required order: registration, booking, create-campaign, add-client
  • •Long full-page flows of 5+ steps whose step names carry meaning: variant="vertical" beside the form
  • •Medium flows of 3–5 steps, often in a Dialog, whose step names matter: variant="horizontal"
  • •Short flows of 5 steps or fewer in a Dialog or card, where the step names add nothing: variant="linear-progress"

When not to use

  • •Peer sections that can be visited in any order — use Tabs
  • •Progress of an upload, a task or a profile's completeness — use Progress
  • •A trail of where a page sits in the site — use Breadcrumb
  • •Paging through results — use Pagination
  • •A one-step form — a form needs no step indicator

Variants

PropValuesDefaultDescription
variantverticalhorizontallinear-progressnone (required)vertical: a column of markers, labels and optional descriptions, for long full-page flows. horizontal: a row of markers with labels underneath, for medium flows, often in a Dialog; under 448px the labels fold and the current one shows below. linear-progress: the Progress bar filled to step N of M, value only, for short flows.

Anti-patterns

Avoid<CardHeader>
  <div className="text-muted-foreground text-xs font-semibold uppercase">Step 1 of 7 · Visit details</div>
  <CardTitle>Schedule a visit</CardTitle>
</CardHeader>
Prefer<CardHeader>
  <CardTitle>Schedule a visit</CardTitle>
  <CardAction><StepperCount currentStep={1} totalSteps={7} /></CardAction>
</CardHeader>

The step count belongs at the right end of the header row, not in an eyebrow above the title. The eyebrow repeated the step name and opened a gap above the title (campus feedback, round 1).

Avoid<div className="flex justify-between text-sm"><span>Step 2 of 5</span><span>40% complete</span></div>
<Progress value={40} />
Prefer<Stepper variant="linear-progress" currentStep={2} totalSteps={5} />

linear-progress shows the value only and announces the value "Step 2 of 5" to screen readers. The count sits in the card header, not above the bar, and a percentage caption repeats it.

Avoid<ol className="flex gap-4">
  {steps.map((s, i) => <li key={s.id} className={i < step ? "text-primary" : ""}>{i + 1}. {s.label}</li>)}
</ol>
Prefer<Stepper variant="horizontal" steps={steps} currentStep={step} />

A hand-built list has no aria-current, no spoken status per step and no narrow-screen fold, and every team draws the markers differently.

Accessibility

  • Required ARIAaria-label on the list or progressbar (defaults to "Progress")aria-current="step" on the current steparia-valuetext "Step N of M" on the linear-progress bar
  • Min touch target32px
  • Screen readervertical and horizontal render an <ol> named "Progress". Each step is a list item; markers are aria-hidden; every step but the current one ends with screen-reader text (", completed", ", not started", ", needs attention"), and the current one is announced as "current step" through aria-current. Folded horizontal labels stay in the accessibility tree as sr-only. linear-progress is a progressbar with aria-valuenow N, aria-valuemax M and aria-valuetext "Step N of M". StepperCount is plain visible text.
  • ContrastStates differ by shape as well as colour: check (complete), thick ring and bold label (current), thin ring (upcoming), "!" (needs attention). The upcoming ring uses the input border token, the same one text fields and checkboxes use. In light mode it is about 5.4:1 to 5.9:1 against background and card. In dark mode it is about 6.9:1 on card and 5.9:1 on popover. The "!" on a needs-attention marker uses destructive-foreground on destructive: about 4.6:1 in light mode and 6:1 in dark mode.

Token bindings

TokenCategoryUsage
primarycolorComplete marker fill, current marker ring and number, and lines up to the current step
primary-foregroundcolorThe check on a complete marker
inputcolorUpcoming marker ring
bordercolorLines after the current step
foregroundcolorLabels of complete, current and needs-attention steps
muted-foregroundcolorUpcoming labels, descriptions and StepperCount
destructivecolorThe marker of a step that needs attention
destructive-foregroundcolorThe "!" on a step that needs attention
ringcolorFocus ring on a clickable step
size-8spacingMarker size (32px)
Recent changes
  • new

    Stepper: one step indicator for wizards

    2026-10-30

[!NOTE] Compound component — an opinionated composition of Helix primitives. Composes: Progress. Sits in a Card or Dialog; the footer is the wizard footer from helix-form-patterns.

Import

import { Stepper, StepperCount } from "@timelycare/helix-ui"

Usage

const [step, setStep] = useState(1)
const [visitType, setVisitType] = useState("")
const missing = step === 1 && !visitType ? "Pick a visit type to continue" : null

<Card>
  <CardHeader>
    <CardTitle as="h2">Schedule a visit</CardTitle>
    <CardAction><StepperCount currentStep={step} totalSteps={7} /></CardAction>
    <CardDescription>Tell us what the visit is for.</CardDescription>
  </CardHeader>
  <CardContent className="grid gap-5">
    <Stepper variant="linear-progress" currentStep={step} totalSteps={7} />
    <Field>
      <FieldLabel htmlFor="visit-type">Visit type</FieldLabel>
      <Input id="visit-type" value={visitType} onChange={(e) => setVisitType(e.target.value)} />
    </Field>
  </CardContent>
  <CardFooter className="gap-2">
    {step > 1 && <Button variant="outline" onClick={() => setStep(step - 1)}>Back</Button>}
    <div className="ml-auto flex items-center gap-3">
      {missing && <p id="visit-missing" className="text-muted-foreground text-sm">{missing}</p>}
      <Button disabled={!!missing} aria-describedby={missing ? "visit-missing" : undefined} onClick={() => setStep(step + 1)}>Next</Button>
    </div>
  </CardFooter>
</Card>

Choosing a variant

VariantUse whenWhat it draws
verticalLong full-page flows (5+ steps) whose step names carry meaningA rail beside the form: a marker per step, its name, and an optional one-line description
horizontalMedium flows (3–5 steps), often in a dialog, whose step names matterA row above the form: markers joined by lines, each name centred underneath
linear-progressShort flows (5 steps or fewer) where the step names add nothingThe Progress bar, filled to step N of M

linear-progress shows the value only: the bar, with no "20% complete" caption next to it. The bar fills N of M, so step 1 of 7 is a seventh full and the last step is full while its Submit button is still ahead.

The header row

"Step N of M" belongs at the right end of the header row, whichever variant you use. Put StepperCount in CardAction, between CardTitle and CardDescription; CardHeader already lays the action out on the right. Do not add a small uppercase label above the title ("STEP 1 OF 7 · VISIT DETAILS"). The title says what this step is.

A dialog has no action slot, and its close button sits in the top-right corner. End the title row with the count instead, and keep it clear of the close button:

<DialogHeader>
  <div className="flex items-baseline justify-between gap-4 pr-8">
    <DialogTitle>Create campaign</DialogTitle>
    <StepperCount currentStep={step} totalSteps={4} />
  </div>
  <DialogDescription>Follow the steps to create and launch your campaign.</DialogDescription>
</DialogHeader>
<Stepper variant="horizontal" steps={steps} currentStep={step} onStepSelect={setStep} />

Steps and their states

currentStep counts from 1, and you control it. Steps before it show as done (a check), the current one has a bold ring and a bold name, and later ones have a thin grey ring. A step's state overrides that: "complete" for a later step someone already finished before going back, "error" for a step that needs attention (a red "!").

Keep step names to two or three words in sentence case: "Visit details", "Review & launch".

Going back

Pass onStepSelect and every earlier step becomes a button that takes someone back. A later step marked "complete" or "error" becomes one only when every step between the current one and it is complete, so nobody can skip a step they have not finished. Upcoming steps never do: moving forward is the Next button's job, and Next waits until the step is valid. Clicking ahead still leaves the current step unchecked: in onStepSelect, check the current step first when the target is after it. Without onStepSelect, the indicator is not clickable at all.

Narrow screens

A horizontal Stepper narrower than 448px keeps its markers and lines, moves the step names to screen readers only, and shows the current step's name once under the row. That covers phones and narrow dialogs with no code from you.

A vertical rail has no room beside the form on a phone. Render the rail from md up and a horizontal Stepper below it:

<div className="grid gap-6 md:grid-cols-3">
  <Stepper variant="vertical" steps={steps} currentStep={step} className="hidden md:block" />
  <Stepper variant="horizontal" steps={steps} currentStep={step} className="md:hidden" />
  <Card className="md:col-span-2">…</Card>
</div>

What Stepper does not do

Stepper draws the indicator only. The footer (Back on the left from step 2, Next on the right, disabled until the step is valid, with a muted line saying what is missing) is the wizard footer in helix-form-patterns, built from Buttons. Moving focus to the new step's heading or first field after a step change is yours too.

TimelyCare Design System

v0.14.0