Skip to content
Cynosurev0.5.0
SearchStorybookGitHubnpmColour mode: System. Switch to Light

Components / Feedback and display

Steps

Shows progress through an ordered flow, such as a setup wizard or a checkout: numbered steps, finished ones ticked, the current one marked.

Shows where the person is

When to useLink to "When to use"

  • A flow of a few named steps that the person moves through in order.

Use something else when:

  • the progress is an amount (bytes, items): ProgressBar
  • the sections can be visited in any order: Tabs

UsageLink to "Usage"

tsx
Copy
import { Steps } from "@arshad-shah/cynosure";

<Steps
  steps={[
    { id: "account", label: "Account", description: "Email and password" },
    { id: "workspace", label: "Workspace" },
    { id: "done", label: "Done" },
  ]}
  current={step}
/>

Steps before current are complete and steps after it upcoming. Set a step's status to error to flag a problem, or to complete to mark it done out of order.

Errors and overrides

Choosing a stepLink to "Choosing a step"

Pass onStepSelect and each step becomes a button that calls it with the step's id. The current step and steps with disabled: true do nothing when pressed. Which steps may be visited is your decision: disable the ones that are not ready.

Going back updates the steps

VerticalLink to "Vertical"

Vertical

PropsLink to "Props"

Every prop of Steps
PropWhat it doesTypeDefault
stepsRequired
The steps, in order.StepItem[]
current
id of the step the person is on. Steps before it are complete, steps after it upcoming. Leave it out for a numbered how-to (steps to follow, not progress): every step is numbered alike and no status is read.string
orientation
Lays the steps out in a row or in a column. Default "horizontal"."horizontal" | "vertical""horizontal"
onStepSelect
Makes steps buttons that go to that step. Leave it out for a read-only progress display.((id: string) => void)
size
Text size of labels and markers.Size
labels
Replace the built-in English text: the list's name and the status read after each step.Partial<StepsLabels>
className
Added to the root element, for layout.string
style
Layout only. Restyle through --cy-steps-* tokens.CSSProperties

Generated from the type definitions in @arshad-shah/cynosure 0.5.0.

Behaviour and accessibilityLink to "Behaviour and accessibility"

  • Structure: an ordered list named "Progress" (labels.list). The current step has aria-current="step", and each step says its state after its label: "completed", "current step", "not started" or "has a problem" (all in labels).
  • Keyboard (with onStepSelect):
Behaviour and accessibility, table 1
KeyAction
Tab / Shift+TabMove between steps
Enter / SpaceGo to the focused step
  • Touch: steps are at least 44px square on touch screens (24px with a mouse).
  • Contrast: labels keep 4.5:1, markers 3:1 against the page, in light and dark modes.
  • Direction: steps run with the text direction.

ThemingLink to "Theming"

Tokens: --cy-steps-marker-size, --cy-steps-line-width and --cy-steps-gap. Colours come from the accent, danger, line and muted tokens.

ts
Copy
createTheme({ components: { steps: { markerSize: "32px", lineWidth: "1px" } } });

ProgressBar · Tabs

These examples run Cynosure 0.5.0 (commit 50ce30b), the version on npm.

Getting started
Theming
Icons
Accessibility
Code editors and highlighters
Using Cynosure without React
Build-tool adapters
Components
Accordion
AppShell
AspectRatio
Breadcrumbs
Calendar
Card
Container
Disclosure
Divider
DocumentViewport
Grid
Inline
PageHeader
PanZoomCanvas
ScrollArea
SideNav
SortableList
SplitPane
Stack
StatusBar
Tabs
TitleBar
Toolbar
Tree
VirtualList
ZoomControls
Announcer
Avatar
Badge
CodeBlock
DescriptionList
EmptyState
ErrorBoundary
Field
Heading
IconTile
Image
Kbd
List
LoadingDots
Notice
ProgressBar
Prose
Skeleton
Stat
Steps
Table
Text
Button
Checkbox
Checklist
ColorField
ColorSwatches
Combobox
CompareSlider
CopyButton
DateField
FileDrop
IconButton
KeyValueEditor
Link
NumberField
Pagination
PathField
RadioGroup
SearchField
SegmentedControl
Select
SelectionFrame
SignaturePad
Slider
Switch
TagInput
TextArea
TextField
ThemeToggle
TimeField
ButtonBase
ChoiceBase
DialogBase
FileInputBase
HiddenValue
Icon
InputBase
LinkBase
LiveRegion
TextAreaBase
ChatMessage
Choice
DataGrid
DeviceFrame
HighlightedText
HotkeyField
ListRow
OptionList
OverlayFrame
QRCode
RowActions
Section
SiteFooter
SiteHeader
SkipLink
SortButton
VisuallyHidden
CommandPalette
ContextMenu
Dialog
FloatingToolbar
HoverCard
Menu
Menubar
Popover
ProgressOverlay
Sheet
Toast
Tooltip
Changelog