Skip to contentWolf-Rayet

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/react
import '@wolf-rayet/react/css/wolf-rayet.css';
import { ProgressIndicator } from '@wolf-rayet/react';

Props

A required prop is marked with an asterisk.

PropTypeDefaultDescription
total *numberNoneHow many steps there are. One dot is drawn for each.
defaultSelectednumber0The step selected on first render, counted from zero.
labelstring'Progress'Names the group for a screen reader. Say what the steps are, not that they are steps.
onSelect(index: number) => voidNoneCalled 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.