Default
- InviteAdd people
- PlanChoose a plan, not started
Show the codeHide the code
Default, code
<Steps current={3} onStepPress={() => {}} />Progress through a task in order. Completed steps show a tick and can be revisited; the current step is marked.
These are the real React components. Use them with a mouse, touch or keyboard, and switch the theme and density for every example at once.
Default, code
<Steps current={3} onStepPress={() => {}} />Vertical, code
<Steps current={3} orientation="vertical" onStepPress={() => {}} />Attention, code
const steps: Step[] = [
{ label: 'Account', description: 'Name and email' },
{ label: 'Workspace', description: 'Name your team' },
{ label: 'Invite', description: 'Add people' },
{ label: 'Plan', description: 'Choose a plan' },
];
<Steps
current={3}
steps={[{ label: 'Your details' }, { label: 'Payment', description: 'Card declined: try another card', attention: true }, { label: 'Review' }, { label: 'Confirm' }]}
/>Links, code
const steps: Step[] = [
{ label: 'Account', description: 'Name and email' },
{ label: 'Workspace', description: 'Name your team' },
{ label: 'Invite', description: 'Add people' },
{ label: 'Plan', description: 'Choose a plan' },
];
<Steps current={3} steps={steps.map((s, i) => ({ ...s, href: `#step-${i + 1}` }))} />The 15 design tokens Steps reads, with the value each has in the theme and density chosen above. Change a token and the component follows, in Figma and in code.
| Token | Value now | CSS variable |
|---|---|---|
| color.action.primary | … | --sd-color-action-primary |
| color.bg.canvas | … | --sd-color-bg-canvas |
| color.bg.subtle | … | --sd-color-bg-subtle |
| color.border.control | … | --sd-color-border-control |
| color.border.danger | … | --sd-color-border-danger |
| color.icon.danger | … | --sd-color-icon-danger |
| color.text.brand | … | --sd-color-text-brand |
| color.text.default | … | --sd-color-text-default |
| color.text.on-primary | … | --sd-color-text-on-primary |
| color.text.secondary | … | --sd-color-text-secondary |
| radius.full | … | --sd-radius-full |
| shape.radius-control | … | --sd-shape-radius-control |
| spacing.gap.md | … | --sd-spacing-gap-md |
| spacing.gap.sm | … | --sd-spacing-gap-sm |
| target.min | … | --sd-target-min |
The npm package isn’t published yet. When it is, this is the install line; until then, this page runs the same build of the package (from commit fa3abf8).
Install
npm i @superduperui/react @superduperui/tokensImport
import { Steps } from "@superduperui/react"Steps also takes the props of the React Aria component it’s built on.
| Prop | Type | What it does |
|---|---|---|
stepsrequired | Step[] | |
currentrequired | number | The current step, 1-based. Steps before it are complete. |
onStepPress | (step: number) => void | Button mode: called when a completed step is chosen. |
aria-label | stringDefault 'Progress' | Names the list. Default "Progress". |
orientation | 'horizontal' | 'vertical'Default 'horizontal' | |
className | string |
Screen readers announce "Progress, list, 4 items" then "Account, completed, button" and "Invite, current step".
WCAG 2.2 AAA criteria the component meets in Comfortable density: 1.4.6, 1.4.9, 2.1.3, 2.3.2, 2.4.13, 2.5.5, 2.5.6.
Compact density meets AA (2.5.8, 24px targets), not AAA.
Shared patterns it ships with: 2.4.8 (aria-current="step").
| axe-core (WCAG A, AA, AAA and best practice) | 100 runs across every story, theme, density and width: 0 violations |
|---|---|
| Rendered text contrast | 560 text runs: 0 below 7:1, lowest 8.4:1 |
| Target size | 22 targets: 0 under 44px in Comfortable |
| Focus appearance (2.4.13) | 36 focus stops in 3 browser engines: all pass |
| Keyboard script | Chromium 3 of 3, Firefox 3 of 3, WebKit 3 of 3 |
Manual passes with VoiceOver and NVDA haven’t been done yet.
Each step is scripted and run in Chromium, Firefox and WebKit.
| Key | What happens |
|---|---|
| Tab | Tab reaches the first completed step |
| Tab | Tab reaches the second completed step |
| Shift+Tab | The current and upcoming steps are not stops; Shift+Tab goes back |
The Figma component is Steps, with Orientation (Horizontal, Vertical); Count (2, 3, 4, 5, 6). The Figma library isn’t published yet.
Figma to code: Orientation → orientation (Horizontal = "horizontal", Vertical = "vertical"); Current → current; Count (2, 3, 4, 5, 6; preview only); nested Step → steps.