Progress indicator
A progress indicator shows users which step they are on.
Install
One package and one stylesheet. The stylesheet holds the tokens every component uses.
pnpm add @wolf-rayet/reactimport '@wolf-rayet/react/css/wolf-rayet.css';
import { ProgressIndicator } from '@wolf-rayet/react';Props
A required prop is marked with an asterisk.
| Prop | Type | Default | Description |
|---|---|---|---|
| total * | number | None | How many steps there are. One dot is drawn for each. |
| defaultSelected | number | 0 | The step selected on first render, counted from zero. |
| label | string | 'Progress' | Names the group for a screen reader. Say what the steps are, not that they are steps. |
| onSelect | (index: number) => void | None | Called with the new index when a dot is chosen. |
Accessibility
What the component does for you, and what it needs from you.
- The group is a tablist and each dot is a tab, so screen readers announce the set as one control, not as separate buttons.
- Each dot is labelled with its position, as in Step 2 of 5.
- You supply the label. Without it the group is announced as Progress, which does not tell people which flow they are in.