Navigation

Steps

Progress indicator for wizards, checklists, and status lists. The skipped state is stepper-only.

import { Steps } from '@lostgradient/cinder';
navigationprogress
01

Overview

Reference usage

Step indicator for multi-step wizards and onboarding flows, a first-run checklist whose steps complete in any order, and a status list for the progress of a short job.

Usage

svelte
<script lang="ts">
  import { Steps } from '@lostgradient/cinder';
  import type { StepItem } from '@lostgradient/cinder';

  const steps: StepItem[] = [
    { id: 'account', label: 'Account' },
    { id: 'profile', label: 'Profile' },
    { id: 'review', label: 'Review' },
  ];
</script>

<Steps {steps} currentStep={0} label="Onboarding" />

Checklist

variant="checklist" is a grouped list of rows for a first-run list, drawn as GroupedList is drawn: no outer border and no header band, the rows one rounded surface with separators that start at the text. Steps complete in any order, so there is no currentStep: mark a step finished with done, and the current step is the first one that isn't. The heading sits at the start of the line above the rows, as a Section's title does, and the counter ("0 of 3 done") at the end, which progressLabel can reword. Each step can carry an action snippet that receives the step's state, so the current step gets the primary button and the others a secondary one. On a narrow container the actions drop under the text, and a quiet action that leads them is pulled back by its own padding so its words start on the text edge. A done step passes no action and swaps its description to say what happened.

svelte
<script lang="ts">
  import { Button, Steps } from '@lostgradient/cinder';
  import type { StepItem } from '@lostgradient/cinder';

  const steps: StepItem[] = [
    {
      id: 'provider',
      label: 'Connect a provider',
      description: 'Agents need a model provider before they can answer.',
      action: provider,
    },
    {
      id: 'agent',
      label: 'Create an agent, or start from Assistant',
      description: 'Assistant works now; other agents need a provider.',
      action: agent,
    },
    {
      id: 'hello',
      label: 'Say hello',
      description: 'Send a first message to see a chat run end to end.',
      action: hello,
    },
  ];
</script>

{#snippet provider(state)}
  <Button variant={state === 'current' ? 'primary' : 'secondary'} label="Connect a provider" />
{/snippet}
{#snippet agent()}
  <Button variant="secondary" label="Create an agent" />
{/snippet}
{#snippet hello()}
  <Button variant="secondary" label="Start a chat" />
{/snippet}

<Steps {steps} variant="checklist" heading="Get started" />

The root is a <section> named by the heading rather than a navigation landmark, because a checklist's actions do their own navigating. On a narrow container the actions drop under the text as a wrapping row from the text's leading edge, each button at its own width.

Status list

variant="status" is a borderless list of progress by step, such as a restart's "Saved your choice, Stopped the server, Starting Interborough, Checking plugins". Mark finished steps with done. The first unfinished step is current when its outcome is still pending. Each row shows a check, a spinner, a hollow circle, or a dashed ring. The list is a role="status" region that announces changes. Assistive technology reads completedLabel, currentLabel ("In progress"), pendingLabel ("Pending"), or unknownLabel ("Outcome unknown") before the step label.

svelte
<script lang="ts">
  import { Steps } from '@lostgradient/cinder';
  import type { StepItem } from '@lostgradient/cinder';

  const steps: StepItem[] = [
    { id: 'saved', label: 'Saved your choice', done: true },
    { id: 'stopped', label: 'Stopped the server', done: true },
    { id: 'starting', label: 'Starting Interborough' },
    { id: 'plugins', label: 'Checking plugins' },
  ];
</script>

<Steps {steps} variant="status" label="Restart progress" />

Unknown outcome

Use state: 'unknown' in a checklist or status list when the page cannot observe a step's outcome. The step shows a neutral dashed ring and counts as unfinished. When the first unfinished step is unknown, the list has no current step or spinner, and later unfinished steps stay pending. The unknownLabel prop supplies the visually hidden prefix, which defaults to "Outcome unknown". Use a callout to explain the outcome to the user.

Interactive steps

A step is static text by default. Give a StepItem an href or an onclick and its body (label + description) becomes a focusable control — an <a> for href, a <button> for onclick. The marker circle and the connector line stay decorative, so only the body region is clickable and the marker never joins the accessible name.

svelte
<script lang="ts">
  const steps = [
    { id: 'account', label: 'Account', href: '#account' },
    { id: 'profile', label: 'Profile', onclick: () => goToProfile() },
    { id: 'review', label: 'Review' }, // plain, non-interactive
  ];
</script>

When a step has both href and onclick, it renders as a link and still runs the callback on click — the consumer decides whether to preventDefault (for SPA routing interception, analytics, or confirmation). For the current step, aria-current="step" moves onto the interactive element; static steps keep it on the list item.

Compact narrow layout

At 32rem and narrower a horizontal stepper restacks into a vertical list, which pushes the page under it a long way down on a phone. Set narrowLayout="compact" to keep it one row instead. Only the current step's label is shown, on a line of its own below the markers, where it wraps and is never cut short. Wider than 32rem the stepper is unchanged.

svelte
<script lang="ts">
  import { Steps } from '@lostgradient/cinder';
  import type { StepItem } from '@lostgradient/cinder';

  const steps: StepItem[] = [
    { id: 'account', label: 'Account', href: '#account' },
    { id: 'profile', label: 'Profile', href: '#profile' },
    { id: 'invite', label: 'Invite teammates', href: '#invite' },
    { id: 'review', label: 'Review', href: '#review' },
  ];
</script>

<Steps {steps} currentStep={2} narrowLayout="compact" label="Onboarding" />
  • The other labels and every description are hidden from view in the compact row. They stay in each step's accessible name.
  • A step with an href or onclick is still a link or button: a round target centred on its marker, 32px across where the column allows. On a coarse pointer its hit area grows to 44px, or the width of its column if that is narrower.
  • Once every step is complete there is no current step, so the row has no label under it.
  • Up to about eight steps keep comfortable targets on a 320px screen. Beyond that the targets get small, so group the flow or use the stacked layout.
  • On a coarse pointer the hit area reaches a few pixels above the row. Don't place the stepper flush against the top of a box that clips its overflow.
  • The line under the row renders the current step's label a second time, so a label snippet must not set an id.
  • Vertical steppers and the checklist and status variants ignore narrowLayout.

Skipped steps

In the stepper, currentStep marks the active index. Earlier steps are complete and later steps are upcoming. Set the stepper-only state: 'skipped' on a past step when a flow advances without completing it. Skipped steps keep their numeric marker, use neutral styling, and announce skippedLabel.

svelte
<script lang="ts">
  const steps = [
    { id: 'account', label: 'Account' },
    { id: 'profile', label: 'Profile', state: 'skipped' },
    { id: 'review', label: 'Review' },
  ];
</script>
Live preview

First-run checklist

Get started

0 of 3 done
  1. Connect a provider Agents need a model provider before they can answer.
  2. Create an agent, or start from Assistant Assistant works now; other agents need a provider.
  3. Say hello Send a first message to see a chat run end to end.

02

When to use

Use when
  • Guide a wizard or checkout through ordered stages.
  • Show a first-run checklist with independent actions.
  • Report a short job’s progress or completion by step.
  • Show an unknown status or checklist outcome with a dashed ring and unknownLabel. An unknown first unfinished step stops the spinner.
Avoid when
  • Switching between independent peer views with no order — use tabs instead.
  • Showing ancestor hierarchy of the current page — use breadcrumbs instead.
03

Examples

First-run checklist

variant="checklist" is a grouped list of rows under a heading, a "N of M done" counter and an action per step. Steps complete in any order: done marks a step, and the first step that is not done is current.

Compact on narrow screens

narrowLayout="compact" keeps the stepper one row at 32rem and narrower, naming only the current step below it. Each step’s link stays on its marker.

Completed (terminal state)

Passing `currentStep={steps.length}` advances past the final step, marking every step complete — the terminal "done" state shown after a flow finishes.

Interactive steps

A step becomes navigable when its `StepItem` carries an `href` (renders the body as a link) or an `onclick` (renders it as a button). The marker and connector stay decorative — only the body region is the focusable, clickable target.

Skipped step

Use `state: "skipped"` when a flow advances past a step without completing it.

Progress by step

variant="status" lists what is done, what is running and what is waiting, as a status region that announces changes.

Vertical orientation

Set `orientation="vertical"` to stack the steps top-to-bottom with the connector running down the side — useful in narrow side panels or wizards.

04

Props

Props for steps
Name
Type
Default
Description
steps required StepItem[] Ordered list of step entries from first to last.
currentStep number 0 Zero-based index of the active step in the 'stepper' variant. Steps with index < currentStep are "completed". Pass steps.length to mark every step as complete (terminal "done" state). The 'checklist' and 'status' variants ignore it and read each step's done instead.
variant 'stepper' | 'checklist' | 'status' 'stepper' Which list the steps render as: 'stepper' is the ordered wizard indicator, 'checklist' is a grouped list of rows that each carry an action, and 'status' is a list of progress by step.
orientation 'horizontal' | 'vertical' 'horizontal' Layout direction of the 'stepper' variant. The 'checklist' and 'status' variants are always vertical. Defaults to 'horizontal'.
narrowLayout 'stacked' | 'compact' 'stacked' What a horizontal 'stepper' does at 32rem and narrower: 'stacked' restacks it vertically, and 'compact' keeps it one row with the current step's label below. With 'compact', a snippet label renders a second time for that line, so it must not set an id. Ignored by vertical steppers and the other variants.
heading text Title of the 'checklist' list, such as "Get started". It sits at the start of the line above the rows, with the counter at the end, and names the section.
headingLevel 123456 3 Heading level for heading.
progressLabel (done: number, total: number) => string Text of the counter at the end of the 'checklist' header, from how many steps are done and how many there are. Defaults to "N of M done".
label text 'Progress' Accessible name for the wrapper: the nav landmark of the 'stepper', the status region of the 'status' variant, and the section of a 'checklist' that has no heading. Defaults to 'Progress'.
completedLabel text 'Completed' Visually-hidden text prepended to completed steps so screen readers announce state + label. Defaults to 'Completed'.
skippedLabel text 'Skipped' Visually-hidden text prepended to skipped steps so screen readers announce state + label. Defaults to 'Skipped'.
currentLabel text 'In progress' Visually-hidden text announced for the step in progress in the 'status' variant.
pendingLabel text 'Pending' Visually-hidden text announced for a step that hasn't started in the 'status' variant.
unknownLabel text 'Outcome unknown' Visually-hidden text prepended to an unknown step in a checklist or status list.