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
Vertical
Segments
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
| Variant | What it is |
|---|---|
| bar | Numbered, horizontal. |
| vertical | For side panels. |
| segments | Thin bars on phones and kiosk. |
| states | done (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
| Prop | Type | Default | Description |
|---|---|---|---|
steps | StepperStep[] | — | Steps in order; may be empty for `segments` with `count`. |
current | number | 0 | Current step, 0-based |
variant | StepperVariant | 'bar' | 'bar' numbered horizontal | 'vertical' side panels | 'segments' thin bars (phones, kiosk) |
count | number | 4 | Number of segments when `steps` is empty |
label | string | "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>
| Kind | Name | Description |
|---|---|---|
| property / JSON attribute | steps | Steps in order; may be empty for `segments` with `count`. |
| attribute | current | Current step, 0-based; default 0 |
| attribute | variant | 'bar' numbered horizontal | 'vertical' side panels | 'segments' thin bars (phones, kiosk); default 'bar' |
| attribute | count | Number of segments when `steps` is empty; default 4 |
| attribute | label | Accessible name; default "Steps" ("Progress" for segments) |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus |