Stepper
Navigation · Stepper, Button
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.
currentis the index of the current step: earlier steps are done, later ones upcoming. A step's ownstatewins ("error"for a step that needs attention).onStepClickturns 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
| Prop | Type | Notes |
|---|---|---|
steps | StepperStep[] | Required |
current? | number | Index of the current step: earlier steps are done, later ones upcoming. |
onStepClick? | (index: number) => void | Makes done steps (and error steps) buttons that go back to them. |
label? | string | Accessible 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? | string | Extra class on the root element. |
style? | CSSProperties | Inline style on the root element. |
Button
| Prop | Type | Notes |
|---|---|---|
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? | boolean | Render the single child element (a link, a router Link) with the button's look instead of a <button>. |
id? | string | |
name? | string | Form field name and value, sent with the form when this button submits it. |
value? | string | |
form? | string | The 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? | string | Extra class on the root element. |
style? | CSSProperties | Inline style on the root element. |