Bonusway design system

Navigation

Stepper

A linear progress indicator for a flow the user moves through in a fixed order — phone-number verification’s enter/verify-old/verify-new legs, an onboarding wizard. Unlike Tabs, steps are not clickable: `activeStep` is the only state.

import Stepper from '@/components/ui/Stepper';

Source: src/components/ui/Stepper.tsx

Examples

Horizontal

  1. Add number
  2. Verify current number
  3. Verify new number

Vertical

  1. Add number
  2. Verify current number
  3. Verify new number

Props

<Stepper> props

PropTypeDefaultDescription
stepsrequiredstring[]—

Step labels, in order.

activeSteprequirednumber—

0-indexed: the step the user is currently on. Earlier steps show done, later ones upcoming.

orientation'horizontal' | 'vertical''horizontal'—
classNamestring''—
activeContentReactNode—

Vertical only: rendered indented under the active step's label, with the connector stretching past it down to the next step — e.g. the form for whichever leg of a multi-step flow the user is currently on. Ignored in horizontal orientation.

Accessibility

  • The current step carries `aria-current="step"`; done steps swap their number for a checkmark, marked `aria-hidden` since the list order already conveys position to a screen reader.

Usage

Do

  • Derive `activeStep` from the flow’s own state (PhoneForm’s `challenge.sentTo`) rather than a counter the component maintains itself — the step the user is on should never disagree with what the form is actually doing.
  • Keep step labels short enough to fit under a single circle in the horizontal layout; a wrapping label still centers, but two short words read faster than a sentence.

Don’t

  • Don’t make steps clickable — this reports progress through a flow the API drives, it doesn’t let the user jump ahead of a challenge they haven’t completed.

Ta strona używa plików cookies

Używamy plików cookie, aby poprawić jakość użytkowania
oraz funkcjonowanie naszej strony i dostosować treści, których Ci dostarczamy. Niezbędne pliki cookie są konieczne do prawidłowego działania naszego serwisu. Jeśli wyrażasz zgodę na gromadzenie przez nas informacji o Tobie za pomocą niezbędnych i marketingowych plików cookie, kliknij „Zaakceptuj wszystko”. Zawsze możesz zmienić swoje preferencje, odwiedzając Ustawienia plików cookie.

Ustawienia cookies