Stepper

Shows the steps of a flow and which one the user is on, like a checkout or a signup. The steps before active are completed.

General

Pass the index of the current step in active and name the list with aria-label.

Clickable steps

With onStepClick, each step is a button that receives its index. A step with disabled cannot be clicked.

Error

Mark a step that failed with error. It shows in red whether it is done or not.

Vertical

Use orientation="vertical" for narrow spaces or long descriptions.

APIs

Stepper.Props

AttributeDescriptionTypeAccepted valuesDefault
activeindex of the current step, from 0number--
onStepClickcalled with the index of the clicked step; turns the steps into buttons(index: number) => void--
orientationdirection of the stepsstring'horizontal', 'vertical'horizontal
...native props, passed to the olOlHTMLAttributes'aria-label', 'id', ...-

Stepper.Step.Props

AttributeDescriptionTypeAccepted valuesDefault
labelname of the stepReactNode--
descriptiontext below the labelReactNode--
iconreplaces the number, the check and the error markReactNode--
errorthe step failedboolean-false
disabledthe step cannot be clicked, with onStepClickboolean-false
...native props, passed to the liLiHTMLAttributes--

Ref

The ref of Stepper points at the ol, and the ref of each step at its li.

Accessibility

The steps are an ordered list, so a screen reader hears how many there are and the position of each. Name the list with aria-label. The current step has aria-current="step", and completed and failed steps say so in text, not only in color. With onStepClick, each step is a real button, reached with Tab.

Edit this page on GitHub