Stepper
Display content divided into a steps sequence
Import
Source
Docs
Package
Usage
Allow step select
To disable step selection, set allowStepSelect
prop on Stepper.Step
component.
It can be used to prevent the user from reaching next steps while letting them go back and forth between steps they've already reached before:
Disable next steps selection
Another way to disable selection of upcoming steps is to use the allowNextStepsSelect
directly on the Stepper
component.
This is useful when you don't need to control the behavior specifically for each step.
Color, radius and size
Component size is controlled by two props: size
and iconSize
.
size
prop controls icon size, label and description font size.
iconSize
allows to overwrite icon size separately from other size values:
With custom icons
You can replace the step icon by setting icon
prop on Stepper.Step
component.
To change completed check icon set completedIcon
on Stepper
component.
You can use any React node as an icon: component, string, number:
You can use Stepper
with icons only. Note that in this case, you will have to
set aria-label
or title
on Stepper.Step
component to make it accessible:
You can also change the completed icon for each step, for example, to indicate error state:
Vertical orientation
Icon position
To change step icon and body arrangement, set iconPosition="right"
:
Loading state
To indicate loading state set loading
prop on Step component, Loader
will replace step icon.
You can configure the default loader in the theme.
Styles API
Stepper
supports Styles API, you can add styles to any inner element of the component withclassNames
prop. Follow Styles API documentation to learn more.
Component Styles API
Hover over selectors to highlight corresponding elements
Examples of styles customization with Styles API:
Get step ref
You can get refs of step button and stepper root element (div):
Wrap Stepper.Step
Stepper
component relies on Stepper.Step
order. Wrapping Stepper.Step
is not supported,
Instead you will need to use different approaches:
Accessibility
<Stepper.Step />
components render button element, set aria-label
or title
props
to make component visible for screen readers in case you do not specify label
or description
: