component
Stepper
Where someone is in a few steps, and how many are left. The steps in a row, a short line between each.
- Details
- Bank
- Review
Defaultimport { Stepper } from 'rost/components/stepper/Stepper'
import { Step } from 'rost/components/step/Step'
<Stepper>
<Step status="done" number={1}>Details</Step>
<Step status="current" number={2}>Bank</Step>
<Step number={3}>Review</Step>
</Stepper> src/components/stepper/Stepper.tsx
import { Children, Fragment, type HTMLAttributes, type ReactNode } from 'react'
import './stepper.css'
export interface StepperProps extends HTMLAttributes<HTMLOListElement> {
/** The Steps, in order. */
readonly children: ReactNode
}
const b = 'rost-stepper'
/**
* The Steps in a row, a short line between each. Built from
* contracts/stepper.contract.yaml.
*/
export function Stepper({ children, className, 'aria-label': label = 'Progress', ...rest }: StepperProps) {
const steps = Children.toArray(children)
return (
<ol aria-label={label} className={[b, className].filter(Boolean).join(' ')} {...rest}>
{steps.map((step, i) => (
<Fragment key={i}>
{i > 0 && <li className={`${b}__connector`} aria-hidden="true" role="presentation" />}
{step}
</Fragment>
))}
</ol>
)
}
The source for everything on this page: contracts/stepper.contract.yaml (opens in a new tab). The CSS, the docs and the checks in each app are built from it.
# yaml-language-server: $schema=../schema/component-contract.schema.json
schemaVersion: 2
id: stepper
name: Stepper
kind: component
status: review
summary: "Where someone is in a few steps, and how many are left. The steps in a row, a short line between each."
category: navigation
related: [ step, progress, tabs ]
source:
tool: figma
fileKey: 1Zy0wiWKXQAvsfDBX3KR0d
nodeId: "744:31"
url: https://www.figma.com/design/1Zy0wiWKXQAvsfDBX3KR0d/UI-Kit-v01?node-id=744-31
extractedAt: "2026-11-16"
extractedBy: hand
frozenAt: "2026-11-16"
props:
children: { type: slot, required: true, notes: "The Steps, in order." }
elements:
root:
notes: "An `<ol aria-label=\"Progress\">` in a row: each Step, then a connector, 8px apart."
styles:
display: { value: flex, assert: false }
align-items: { value: center }
gap: { token: spacing/gap/small, value: 8px }
padding: { token: spacing/gap/none, value: 0px }
list-style: { value: none, assert: false }
connector:
notes: "A 24px line between two steps, in the tertiary grey. Decoration: hidden from screen readers."
styles:
display: { value: block, assert: false }
flex-shrink: { value: "0", assert: false }
width: { token: spacing/size/small, value: 24px }
height: { token: spacing/outline/small, value: 1px }
background: { token: stepper/connector, value: "#3a3a3a" }
guidance:
status: proposed
use:
- title: A few steps in order
text: "Three to five steps that build on each other: setting up a vault, closing a year."
avoid:
- title: Choosing a view
text: "Moving between views in any order. That's **Tabs**."
- title: Long progress
text: "Something with many steps or a count. That's **Progress**."
behaviour: "It lays out the Steps and the lines between them. Each Step knows whether it's done, current or still to come."
accessibility:
element: "`<ol>`, so the steps are counted. The current Step has `aria-current=\"step\"`."
name: "Progress, or what the steps are for."
Install
npx github:Runceanu/rost add stepper It lands in src/rost/stepper/, with what it needs and its contract. Install has the rest.
When to use
A few steps in order
Three to five steps that build on each other: setting up a vault, closing a year.
When not to use
Choosing a view
Moving between views in any order. That's Tabs.
Long progress
Something with many steps or a count. That's Progress.
Behaviour
It lays out the Steps and the lines between them. Each Step knows whether it's done, current or still to come.
Accessibility
- Element
<ol>, so the steps are counted. The current Step hasaria-current="step". - Name
Progress, or what the steps are for.
Props
| Prop | Type | Values | Default |
|---|---|---|---|
children | slot | | |
Values
Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.
Never changes
root
-
gap8pxspacing/gap/small -
padding0pxspacing/gap/none
displayflex · align-itemscenter · list-stylenone
connector
-
width24pxspacing/size/small -
height1pxspacing/outline/small -
background#3a3a3astepper/connector
displayblock · flex-shrink0
Part of Stepper
Step
One step of a Stepper: a 24px marker and its name. A green tick when done, a green ring when current, grey when it is still to come.
- Details
Done- Bank
Current- Review
Upcomingsrc/components/step/Step.tsx
import type { HTMLAttributes, ReactNode } from 'react'
import './step.css'
export interface StepProps extends HTMLAttributes<HTMLLIElement> {
readonly status?: 'done' | 'current' | 'upcoming'
/** Its place, from 1. */
readonly number: number
/** Its name. */
readonly children: ReactNode
}
const b = 'rost-step'
/** One step of a Stepper. Built from contracts/step.contract.yaml. */
export function Step({ status = 'upcoming', number, children, className, ...rest }: StepProps) {
return (
<li className={[b, `${b}--status-${status}`, className].filter(Boolean).join(' ')} aria-current={status === 'current' ? 'step' : undefined} {...rest}>
<span className={`${b}__marker`} aria-hidden="true">{status === 'done' ? <span className={`${b}__check`} /> : number}</span>
<span className={`${b}__label`}>{children}{status === 'done' && <span style={{ position: 'absolute', width: 1, height: 1, overflow: 'hidden', clipPath: 'inset(50%)' }}>, done</span>}</span>
</li>
)
}
The source for everything on this page: contracts/step.contract.yaml (opens in a new tab). The CSS, the docs and the checks in each app are built from it.
# yaml-language-server: $schema=../schema/component-contract.schema.json
schemaVersion: 2
id: step
name: Step
kind: component
status: review
partOf: stepper
summary: "One step of a Stepper: a 24px marker and its name. A green tick when done, a green ring when current, grey when it is still to come."
category: navigation
related: [ stepper, checkbox ]
source:
tool: figma
fileKey: 1Zy0wiWKXQAvsfDBX3KR0d
nodeId: "744:30"
url: https://www.figma.com/design/1Zy0wiWKXQAvsfDBX3KR0d/UI-Kit-v01?node-id=744-30
extractedAt: "2026-11-16"
extractedBy: hand
frozenAt: "2026-11-16"
props:
status:
type: enum
values: [ done, current, upcoming ]
default: upcoming
number: { type: number, required: true, notes: "Its place, from 1. It shows in the marker until it's done." }
children: { type: slot, required: true, notes: "Its name, a word or two." }
elements:
root:
notes: "An `<li>`: the marker and the name, 8px apart."
styles:
display: { value: inline-flex, assert: false }
align-items: { value: center }
gap: { token: spacing/gap/small, value: 8px }
marker:
notes: "The 24px circle with the number, or a tick when done."
styles:
display: { value: inline-flex, assert: false }
align-items: { value: center }
justify-content: { value: center }
position: { value: relative, assert: false }
flex-shrink: { value: "0", assert: false }
width: { token: spacing/size/small, value: 24px }
height: { token: spacing/size/small, value: 24px }
border-radius: { token: spacing/radius/full, value: 10000px }
outline-style: { value: solid, assert: false }
outline-offset: { value: "calc(-1 * var(--spacing-outline-medium))", untokenised: "Composed from a token: the edge sits inside the marker." }
font-family: { token: font-family/base, value: "'General Sans Variable'" }
font-weight: { token: typography/label/font-weight/medium, value: "500" }
font-size: { token: typography/label/font-size, value: 12px }
line-height: { token: typography/label/line-height, value: 14px }
letter-spacing: { token: typography/label/letter-spacing, value: 0px }
check:
optional: true
notes: "Checkbox's tick, 16px, as a mask in the colour of a primary button's label."
styles:
display: { value: block, assert: false }
width: { token: spacing/size/2xsmall, value: 16px }
height: { token: spacing/size/2xsmall, value: 16px }
mask: { value: url(./icon-check.svg) center / contain no-repeat, untokenised: The icon file itself. }
label:
notes: "The step's name in paragraph type."
styles:
font-family: { token: font-family/base, value: "'General Sans Variable'" }
font-weight: { token: typography/paragraph/font-weight/regular, value: "400" }
font-size: { token: typography/paragraph/font-size, value: 14px }
line-height: { token: typography/paragraph/line-height, value: 20px }
letter-spacing: { token: typography/paragraph/letter-spacing, value: 0px }
white-space: { value: nowrap, assert: false }
variants:
- when: { status: done }
figmaNode: "744:16"
elements:
marker:
background: { token: step/done/marker, value: "#00d669" }
outline-width: { token: spacing/outline/medium, value: 2px }
outline-color: { token: step/done/marker, value: "#00d669" }
check:
background: { token: step/done/check, value: "#060805" }
label:
color: { token: step/done/label, value: "#d3d9d5" }
- when: { status: current }
figmaNode: "744:21"
elements:
marker:
background: { value: transparent, assert: false }
outline-width: { token: spacing/outline/medium, value: 2px }
outline-color: { token: step/current/edge, value: "#00d669" }
color: { token: step/current/number, value: "#00d669" }
label:
color: { token: step/current/label, value: "#ededed" }
- when: { status: upcoming }
figmaNode: "744:25"
elements:
marker:
background: { value: transparent, assert: false }
outline-width: { token: spacing/outline/small, value: 1px }
outline-color: { token: step/upcoming/edge, value: "#747573" }
color: { token: step/upcoming/number, value: "#999999" }
label:
color: { token: step/upcoming/label, value: "#999999" }
guidance:
status: proposed
use:
- title: Done, here, to come
text: "Each step says which it is: a tick for done, a green ring for where you are, grey for what's left."
show: status=current
avoid:
- title: Steps you can press
text: "A Step isn't a button. If going back is allowed, put a Back button in the form."
behaviour: "Done shows a dark tick on green, current a green ring and number, upcoming a grey ring and number. The words say the same as the colours."
accessibility:
element: "`<li>`; the current one has `aria-current=\"step\"`. A done Step says Done in hidden text, since the tick replaces its number."
colour: "The upcoming ring is 4.3:1 on the dark page, the numbers and names 7:1 or more."
Install
npx github:Runceanu/rost add step It lands in src/rost/step/, with what it needs and its contract. Install has the rest.
When to use
Done, here, to come
Each step says which it is: a tick for done, a green ring for where you are, grey for what's left.
When not to use
Steps you can press
A Step isn't a button. If going back is allowed, put a Back button in the form.
Behaviour
Done shows a dark tick on green, current a green ring and number, upcoming a grey ring and number. The words say the same as the colours.
Accessibility
- Element
<li>; the current one hasaria-current="step". A done Step says Done in hidden text, since the tick replaces its number. - Colour
The upcoming ring is 4.3:1 on the dark page, the numbers and names 7:1 or more.
Props
| Prop | Type | Values | Default |
|---|---|---|---|
status | enum | done · current · upcoming | upcoming |
number | number | | |
children | slot | | |
Values
Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.
Never changes
root
-
gap8pxspacing/gap/small
displayinline-flex · align-itemscenter
marker
-
width24pxspacing/size/small -
height24pxspacing/size/small -
border-radius10000pxspacing/radius/full -
outline-offsetcalc(-1 * var(--spacing-outline-medium))on purpose: Composed from a token: the edge sits inside the marker. -
font-family'General Sans Variable'font-family/base -
font-weight500typography/label/font-weight/medium -
font-size12pxtypography/label/font-size -
line-height14pxtypography/label/line-height -
letter-spacing0pxtypography/label/letter-spacing
displayinline-flex · align-itemscenter · justify-contentcenter · positionrelative · flex-shrink0 · outline-stylesolid
check
-
width16pxspacing/size/2xsmall -
height16pxspacing/size/2xsmall -
maskurl(./icon-check.svg) center / contain no-repeaton purpose: The icon file itself.
displayblock
label
-
font-family'General Sans Variable'font-family/base -
font-weight400typography/paragraph/font-weight/regular -
font-size14pxtypography/paragraph/font-size -
line-height20pxtypography/paragraph/line-height -
letter-spacing0pxtypography/paragraph/letter-spacing
white-spacenowrap
Changes by variant
3 variants. Each table is what one thing changes with: a column per status, a row per property. Where every row starts with the same token path, it's written once, under the property.
Follows status
| Property | Done | Current | Upcoming |
|---|---|---|---|
label.colorstep/… | done/label #d3d9d5 | current/label #ededed | upcoming/label #999999 |
marker.background | step/done/marker #00d669 | transparent | transparent |
marker.outline-colorstep/… | done/marker #00d669 | current/edge #00d669 | upcoming/edge #747573 |
marker.outline-widthspacing/outline/… | medium 2px | medium 2px | small 1px |
All but Done
| Property | Current | Upcoming |
|---|---|---|
marker.colorstep/… | current/number #00d669 | upcoming/number #999999 |
Only in some variants
These don't change: they're just set in some variants and not others.
Done
-
check.background#060805step/done/check