Stepper
Show progress through a numbered sequence of steps.
SourceStyles source@monoline/react 0.5.0Markdown for AI toolsstable
- Built on native elements
- An ordered list; the current step has aria-current="step".
- Completed steps are marked in text for assistive tech, not by colour alone.
- Styles in one file:
18-navigation.css
Import
import '@monoline/css';
import {Stepper} from '@monoline/react';
Not installed yet? Pick a route.
Copies the source and its styles into your project.
npx monoline add stepper
Usage
import {Stepper} from '@monoline/react';
<Stepper
aria-label="Checkout"
current={1}
steps={[{title: 'Account'}, {title: 'Plan', description: 'Pick one'}, {title: 'Payment'}]}
/>
Examples
Checkout
Props
StepperProps
| Prop | Type | Default | Description |
|---|---|---|---|
steps required | StepperStep[] | – | The steps in order, each with a `title` and optional `description`. |
current required | number | – | Zero-based index of the current step. Earlier steps are done. |
Data Attributes
State is exposed through attributes. Style it with these selectors, not with class toggles.
| Attribute | Stylesheet |
|---|---|
[aria-current="page"] | 18-navigation.css |
[aria-current="step"] | 18-navigation.css |
[aria-selected="true"] | 18-navigation.css |
[data-state="done"] | 18-navigation.css |
CSS classes
| Class | Stylesheet |
|---|---|
.brand | 18-navigation.css |
.crumbs | 18-navigation.css |
.pager | 18-navigation.css |
.step | 18-navigation.css |
.steps | 18-navigation.css |
.tab | 18-navigation.css |
.tabpanel | 18-navigation.css |
.topbar | 18-navigation.css |
.topbar-nav | 18-navigation.css |
Customization
Style it with the kit's tokens in your own CSS, loaded after @monoline/css. Prefer the attributes above over extra classes. See Theming for every token.
app.css
.brand {
border-color: var(--accent);
}
.brand[aria-current="page"] {
background: var(--wash);
}
Accessibility
- An ordered list; the current step has aria-current="step".
- Completed steps are marked in text for assistive tech, not by colour alone.