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.

Step 1 of 3:
1 Cart
(completed)
Step 2 of 3:
2 Shipping
(current)
Step 3 of 3:
3 Payment
(pending)
$step: 2
Blade

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.

Step 1 of 3:
Account
(completed)
Step 2 of 3:
Plan
(current)
Step 3 of 3:
Done
(pending)
Blade

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.

Order placed
(completed)

Oct 12, 10:24

Shipped
(current)
Delivered
(pending)
Blade

Icon for the current step #

icon-active sets the icon of the current step, as icon-completed does for the completed ones.

Step 1 of 3:
Details
(completed)
Step 2 of 3:
Address
(current)
Step 3 of 3:
3 Confirm
(pending)
Blade

Colors #

color paints the completed and current steps and the lines between them: any palette color, or accent.

Step 1 of 4:
Cart
(completed)
Step 2 of 4:
Shipping
(completed)
Step 3 of 4:
3 Payment
(current)
Step 4 of 4:
4 Review
(pending)
Step 1 of 4:
Cart
(completed)
Step 2 of 4:
Shipping
(completed)
Step 3 of 4:
3 Payment
(current)
Step 4 of 4:
4 Review
(pending)
Step 1 of 4:
Cart
(completed)
Step 2 of 4:
Shipping
(completed)
Step 3 of 4:
3 Payment
(current)
Step 4 of 4:
4 Review
(pending)
Step 1 of 4:
Cart
(completed)
Step 2 of 4:
Shipping
(completed)
Step 3 of 4:
3 Payment
(current)
Step 4 of 4:
4 Review
(pending)
Blade

Sizes #

size scales the circles, icons and labels, from xs to 3xl.

Step 1 of 3:
1 Cart
(completed)
Step 2 of 3:
2 Shipping
(current)
Step 3 of 3:
3 Payment
(pending)
Step 1 of 3:
1 Cart
(completed)
Step 2 of 3:
2 Shipping
(current)
Step 3 of 3:
3 Payment
(pending)
Step 1 of 3:
1 Cart
(completed)
Step 2 of 3:
2 Shipping
(current)
Step 3 of 3:
3 Payment
(pending)
Step 1 of 3:
1 Cart
(completed)
Step 2 of 3:
2 Shipping
(current)
Step 3 of 3:
3 Payment
(pending)
Blade

Status by hand #

status sets a step to completed, active or pending without current, for progress that is not linear.

Identity
(completed)
Address
(pending)
Documents
(current)
Blade

A step takes the link props of Element, such as href, so the completed steps can lead back.

Cart (completed)
Shipping (completed)
Payment
(current)
Blade

Customization #

Classes go to the row; step: reaches each step from items and line: their lines.

Step 1 of 3:
1 Cart
(completed)
Step 2 of 3:
2 Shipping
(current)
Step 3 of 3:
3 Payment
(pending)
Blade

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).

blade

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; a current past 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 from items. 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 (0 when omitted) and items, and counts its steps separately. Its steps written by hand still inherit size and vertical from the outer stepper when the inner one doesn't set them, while its steps from items don't: set both on the inner stepper when they differ.