Skip to content
Twentyfirst UIHalo

Stepper

Navigation · Stepper, Button

View as Markdown

The steps of a wizard or a setup flow. On wide screens the steps stand in a row with their number, label and an optional description; on phones (or always with variant="compact") it says "Step 3 of 5" with the current step's name and a progress bar.

  • current is the index of the current step: earlier steps are done, later ones upcoming. A step's own state wins ("error" for a step that needs attention).
  • onStepClick turns done and error steps into buttons that go back to them.
  • Screen readers hear the state after each step's name ("Account, done") and the current step is aria-current="step".
  • For a whole wizard page with the steps beside the content, see Wizard.

Props

Stepper

PropTypeNotes
stepsStepperStep[]Required
current?numberIndex of the current step: earlier steps are done, later ones upcoming.
onStepClick?(index: number) => voidMakes done steps (and error steps) buttons that go back to them.
label?stringAccessible name of the steps (default "Steps").
variant?"auto" | "compact"`auto` (default): the row of steps on wide screens, "Step 2 of 5" with a progress bar on phones. `compact` always shows the short form.
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.

Button

PropTypeNotes
variant?"primary" | "secondary" | "soft" | "ghost" | "danger" | "danger-solid"
size?"md" | "sm"
icon?IconName
iconRight?IconName
disabled?boolean
type?"button" | "submit" | "reset"
onClick?(e: MouseEvent<HTMLButtonElement>) => void
children?ReactNode
asChild?booleanRender the single child element (a link, a router Link) with the button's look instead of a <button>.
id?string
name?stringForm field name and value, sent with the form when this button submits it.
value?string
form?stringThe id of the form this button belongs to, when it sits outside it.
title?string
tabIndex?number
autoFocus?boolean
aria-label?string
aria-labelledby?string
aria-describedby?string
aria-expanded?boolean | "true" | "false"For disclosure and menu triggers: whether what the button controls is open.
aria-controls?string
aria-haspopup?boolean | "true" | "false" | "menu" | "listbox" | "tree" | "grid" | "dialog"
aria-pressed?boolean | "true" | "false" | "mixed"For toggle buttons.
aria-current?boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time"
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.