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.

Šī lapa lieto sīkfailus

Mēs izmantojam sīkfailus, lai uzlabotu tavu pieredzi mūsu vietnē un pielāgotu saturu, ko mēs tev piedāvājam. Būtiski sīkfaili ir nepieciešami, lai mūsu pakalpojums darbotos pareizi. Ja esi priecīgs, ka mēs apkopojam informāciju, izmantojot mārketinga sīkdatnes, tad izvelies “Pieņemt visu”. Vienmēr vari mainīt minētos iestatījumus, apmeklējot sīkfailu iestatījumus.

Sīkfailu iestatījumi