Steps

Numbered steps through a sequence, each complete, current or upcoming.

Navigation Added in v0.41.0 Updated

Default

  1. Account
  2. Plan
  3. Payment
  4. Done

{ui steps,
	items: [
		['title' => 'Account'],
		['title' => 'Plan', 'active' => true],
		['title' => 'Payment'],
		['title' => 'Done'],
	],
/}

Each step is an item with a title, and the one marked active is the current step. Steps before it are complete and show a check mark, and steps after it are upcoming. With no step active, all are upcoming. Each request marks the current step, as tabs do, so the server decides where the visitor is. The list is an ol and the current step carries aria-current="step".

Descriptions and links

  1. Account Your name and email
  2. Plan Pick a size
  3. Payment Card or invoice

{ui steps,
	items: [
		[
			'title' => 'Account',
			'description' => 'Your name and email',
			'href' => '#',
		],
		[
			'title' => 'Plan',
			'description' => 'Pick a size',
			'href' => '#',
			'active' => true,
		],
		[
			'title' => 'Payment',
			'description' => 'Card or invoice',
		],
	],
/}

A description sits under the title in muted text. An href makes a step a link, which suits the steps already complete, so the visitor can go back. Leave it off the steps they have not reached.

Vertical

  1. Order placed Monday
  2. Packed Tuesday
  3. On its way Expected Thursday
  4. Delivered

<div class="max-w-xs">
	{ui steps,
		class: 'steps-vertical',
		items: [
			['title' => 'Order placed', 'description' => 'Monday'],
			['title' => 'Packed', 'description' => 'Tuesday'],
			['title' => 'On its way', 'description' => 'Expected Thursday', 'active' => true],
			['title' => 'Delivered'],
		],
	/}
</div>

Steps run in a row from 640px wide and stack below that. class: 'steps-vertical' keeps them stacked at any width, for a sidebar or a delivery timeline.