Navigation
Stepper
The steps of a process and where the user is in it: a numbered circle per step, filled for the completed ones, outlined for the current one, faint for the next ones, joined by lines. It only shows progress; moving between steps is up to your page.
Nothing to show
Three circles in a row, numbered 1 to 3, with their labels under them. Cart is filled (completed), Shipping is outlined (current) and Payment is faint. The line after a completed step is filled too. Changing $step moves the progress.
Icons #
Each step shows its icon instead of its number; completed steps show a check. iconActive does the same for the current step. color paints the completed and current steps green.
Nothing to show
Vertical, with content #
The steps in a column, each with a line down to the next; content in a step's slot sits beside the line, under its label. Steps written by hand are marked with a dot instead of a number once completed or current; pending ones show an empty circle.
Nothing to show
Icon for the current step #
icon-active sets the icon of the current step, as icon-completed does for the completed ones.
Nothing to show
Colors #
color paints the completed and current steps and the lines between them: any palette color, or accent.
Nothing to show
Sizes #
size scales the circles, icons and labels, from xs to 3xl.
Nothing to show
Status by hand #
status sets a step to completed, active or pending without current, for progress that is not linear.
Nothing to show
Steps as links #
A step takes the link props of Element, such as href, so the completed steps can lead back.
Customization #
Classes go to the row; step: reaches each step from items and line: their lines.
Nothing to show
Reference
tk:stepper
└── tk:stepper.step ...
tk:stepper
| Prop | Type | Default | Description |
|---|---|---|---|
items |
array | null |
The steps, as arrays of tk:stepper.step props (label, icon...). |
current |
int | 0 |
The current step, counting from 1. The ones before it are completed. |
vertical |
bool | false |
Lays the steps out in a column. |
iconCompleted |
string | null |
An icon for the completed steps, in place of their number or icon. |
iconActive |
string | null |
An icon for the current step. |
color |
string | neutral | A color name (or accent) for the completed and current steps and the lines between them. |
size |
string | md |
xs, sm, md, lg, xl, 2xl or 3xl. |
Slots
| Slot | Description |
|---|---|
| default | Steps written by hand, after those from items. |
Prefixes
| Prefix | Goes to |
|---|---|
step: |
Each step from items. |
line: |
The lines of the steps from items (step:line: is more specific and wins). |
tk:stepper.step
| Prop | Type | Default | Description |
|---|---|---|---|
label |
string | slot | null |
The step name, translated. |
icon |
string | null |
An icon in the circle, in place of the number. |
status |
string | from current |
completed, active or pending, to set it by hand. |
iconCompleted, iconActive, color |
As on the stepper. The stepper passes them to the steps from items; a step written by hand takes them itself. |
size and vertical are inherited from the stepper; a step written by hand takes its state from the current and items of the stepper it sits in. index and total (the number shown and the "Step 2 of 3" name) are set by the stepper for the steps from items. Also accepts the element props (badge, suffix...) and the link props of Element, to make a step a link.
Slots
| Slot | Description |
|---|---|
| default | Content under the step, beside the line. |
Prefixes
| Prefix | Goes to |
|---|---|
line: |
The lines of this step; a step written by hand takes line: itself. |
icon: |
The icon in the circle. |
bullet: |
The dot of a step written by hand. |
Customization
Classes and attributes on tk:stepper go to the row. To reach the parts, prefix the attribute (listed in the Reference above).
Nothing to show
Accessibility
A role="list" with one role="listitem" per step, holding the step, its lines and its content. Screen readers read the position and the state as hidden text around the label, translated: "Step 2 of 3: Shipping (current)"; a step with href stays a link. The current step has aria-current="step". The lines are hidden from screen readers.
Behavior notes
current="0"(the default) leaves every step pending; acurrentpast the last step marks all of them completed.- Steps written by hand get their state from their order inside the stepper, after those from
items, and count in the "Step 2 of 3" total of the steps fromitems. They don't announce a position of their own. - A stepper can sit in a step's slot. The inner one keeps its own
current(0when omitted) anditems, and counts its steps separately. Its steps written by hand still inheritsizeandverticalfrom the outer stepper when the inner one doesn't set them, while its steps fromitemsdon't: set both on the inner stepper when they differ.