Skip to main content

Stepper

BasicNavigation<co-stepper>

Stepper shows progress through a multi-step flow, such as the 7-step Add Patient form, as a numbered bar, a vertical list or thin segments.

import { Stepper } from 'health-components';

Examples​

Variants​

Storybook

Vertical​

Storybook

Segments​

Storybook

Usage​

<Stepper steps={["Demographics", "Contact", "Insurance"]} current={1} />
<Stepper variant="segments" count={6} current={0} />

When to use​

  • Flows of 3 to 8 steps: Add Patient, check-in, new prior auth.

When not to use​

  • Two steps: just two screens.

Variants and states​

VariantWhat it is
barNumbered, horizontal.
verticalFor side panels.
segmentsThin bars on phones and kiosk.
statesdone (green check), current (primary), todo, error ("!" and red).

Accessibility​

  • Ordered list with aria-current="step"; state words are in screen-reader text.
  • Segments use role progressbar with "Step 2 of 5".

Do and don't​

  • Do: Let people go back to a done step.
  • Don't: Hide errors in later steps until the end.

Props​

PropTypeDefaultDescription
stepsStepperStep[]—Steps in order; may be empty for `segments` with `count`.
currentnumber0Current step, 0-based
variantStepperVariant'bar''bar' numbered horizontal | 'vertical' side panels | 'segments' thin bars (phones, kiosk)
countnumber4Number of segments when `steps` is empty
labelstring"Steps" ("Progress" for segments)Accessible name

Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, plus className and event handlers on the root element.

Angular, Vue and HTML​

Register the elements once (Angular guide), then use <co-stepper>. Attributes take strings; arrays and objects are set as properties (Angular [prop], Vue :prop) or as JSON attributes. Callbacks are DOM events with the value in event.detail.

Angular template
<co-stepper current="…" variant="…" [steps]="steps"></co-stepper>
KindNameDescription
property / JSON attributestepsSteps in order; may be empty for `segments` with `count`.
attributecurrentCurrent step, 0-based; default 0
attributevariant'bar' numbered horizontal | 'vertical' side panels | 'segments' thin bars (phones, kiosk); default 'bar'
attributecountNumber of segments when `steps` is empty; default 4
attributelabelAccessible name; default "Steps" ("Progress" for segments)
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus