Search docs

Steps

Guides users through a multi-step workflow with linear and non-linear navigation.

There is no dedicated WAI-ARIA APG pattern for Steps. Steps uses a semantic ordered list (<ol> in Steps.List and <li> in Steps.Item), sets aria-current="step" on the active step item, and hides decorative indicators and separators with aria-hidden="true".

Enter your email and password to create an account.
import { component$, useStyles$ } from '@builder.io/qwik';
import { Steps } from '@leve-ui/steps';
import styles from './default.css?inline';

export default component$(() => {
  useStyles$(styles);

  return (
    <Steps.Root count={3} class="steps-default">
      <Steps.List class="steps-default-list">
        <Steps.Item index={0} class="steps-default-item">
          <Steps.Trigger class="steps-default-trigger">
            <Steps.Indicator class="steps-default-indicator">1</Steps.Indicator>
            <span>Account</span>
          </Steps.Trigger>
          <Steps.Separator class="steps-default-separator" />
        </Steps.Item>
        <Steps.Item index={1} class="steps-default-item">
          <Steps.Trigger class="steps-default-trigger">
            <Steps.Indicator class="steps-default-indicator">2</Steps.Indicator>
            <span>Profile</span>
          </Steps.Trigger>
          <Steps.Separator class="steps-default-separator" />
        </Steps.Item>
        <Steps.Item index={2} class="steps-default-item">
          <Steps.Trigger class="steps-default-trigger">
            <Steps.Indicator class="steps-default-indicator">3</Steps.Indicator>
            <span>Review</span>
          </Steps.Trigger>
        </Steps.Item>
      </Steps.List>

      <Steps.Content index={0} class="steps-default-content">
        Enter your email and password to create an account.
      </Steps.Content>
      <Steps.Content index={1} class="steps-default-content">
        Add your display name and profile details.
      </Steps.Content>
      <Steps.Content index={2} class="steps-default-content">
        Confirm your information before submitting.
      </Steps.Content>

      <div class="steps-default-actions">
        <Steps.PrevTrigger class="steps-default-nav">Previous</Steps.PrevTrigger>
        <Steps.NextTrigger class="steps-default-nav">Next</Steps.NextTrigger>
      </div>
    </Steps.Root>
  );
});

Installation#

Install the individual package, or use @leve-ui/core to get every component at once:

pnpm add @leve-ui/steps

Anatomy#

import { Steps } from '@leve-ui/steps'; // or '@leve-ui/core'

<Steps.Root count={3}>
  <Steps.List>
    <Steps.Item index={0}>
      <Steps.Trigger>
        <Steps.Indicator>1</Steps.Indicator>
        <span>Account</span>
      </Steps.Trigger>
      <Steps.Separator />
    </Steps.Item>
  </Steps.List>

  <Steps.Content index={0}>Step content</Steps.Content>

  <Steps.PrevTrigger>Previous</Steps.PrevTrigger>
  <Steps.NextTrigger>Next</Steps.NextTrigger>
</Steps.Root>
PartElementDescription
Steps.Root<div>Wraps the parts and manages the active step, total count, linear mode, and orientation.
Steps.List<ol>Ordered list container for step items.
Steps.Item<li>Represents a single step at index and sets aria-current="step" when active.
Steps.Trigger<button>Activates its parent step when clicked. Automatically disabled when blocked by linear mode or item disabled.
Steps.Indicator<span>Decorative visual badge (such as a step number or icon), hidden from assistive technologies.
Steps.Separator<div>Decorative connector line inside a step item, hidden from assistive technologies.
Steps.Content<div>Content panel for a given index. Always rendered, with hidden applied when inactive.
Steps.PrevTrigger<button>Navigates to the previous step. Automatically disabled on the first step.
Steps.NextTrigger<button>Navigates to the next step. Automatically disabled on the last step.

Examples#

Linear#

Pass linear on Steps.Root to prevent jumping ahead to upcoming steps via Steps.Trigger, while still allowing navigation back to completed steps.

Choose your shipping address and delivery speed.

Vertical#

Pass orientation="vertical" on Steps.Root to lay out the steps vertically and propagate data-orientation="vertical" to list, item, and separator parts.

Your order has been received and is being prepared.

Controlled#

Bind a Signal<number> with bind:step to read and update the active 0-based step index from outside.

Step 2 of 3

Customize extra storage and priority support.

API Reference#

Root#

PropDefaultType
count (required)–number

Total number of steps. Used to clamp the active step and disable NextTrigger on the last step.

defaultStep0number

Initial 0-based step index when uncontrolled.

bind:step–Signal<number>

A signal holding the current 0-based step index (controlled).

onStepChange$–QRL<(step: number) => void>

Called when the active step changes.

linearfalseboolean

When true, prevents jumping ahead to upcoming steps via Trigger.

orientation'horizontal''horizontal' | 'vertical'

The layout orientation of the steps list.

Also accepts all <div> attributes.

Data attributeValue
data-leve-stepsAlways present
data-orientation"horizontal" | "vertical"

List#

No props of its own. Accepts all <ol> attributes.

Data attributeValue
data-leve-steps-listAlways present
data-orientation"horizontal" | "vertical"

Item#

PropDefaultType
index (required)–number

0-based index of this step item.

disabledfalseboolean

Disables this step item and its trigger.

Also accepts all <li> attributes.

Data attributeValue
data-leve-steps-itemAlways present
data-state"complete" | "current" | "upcoming"
data-disabledPresent when disabled is true
data-orientation"horizontal" | "vertical"

Trigger#

No props of its own. Accepts all <button> attributes.

Data attributeValue
data-leve-steps-triggerAlways present
data-state"complete" | "current" | "upcoming"
data-disabledPresent when the item is disabled, the trigger is disabled, or linear blocks an upcoming step

Indicator#

No props of its own. Accepts all <span> attributes.

Data attributeValue
data-leve-steps-indicatorAlways present
data-state"complete" | "current" | "upcoming"

Separator#

No props of its own. Accepts all <div> attributes.

Data attributeValue
data-leve-steps-separatorAlways present
data-state"complete" | "current" | "upcoming"
data-orientation"horizontal" | "vertical"

Content#

PropDefaultType
index (required)–number

0-based index of the step this content panel belongs to.

Also accepts all <div> attributes.

Data attributeValue
data-leve-steps-contentAlways present
data-state"open" | "closed"

PrevTrigger#

No props of its own. Accepts all <button> attributes.

Data attributeValue
data-leve-steps-prev-triggerAlways present
data-disabledPresent on the first step or when disabled is true

NextTrigger#

No props of its own. Accepts all <button> attributes.

Data attributeValue
data-leve-steps-next-triggerAlways present
data-disabledPresent on the last step or when disabled is true

Accessibility#

  • Steps.List renders a semantic <ol> and each Steps.Item renders an <li>.
  • The active Steps.Item receives aria-current="step".
  • Steps.Indicator and Steps.Separator render aria-hidden="true" so screen readers skip decorative numbers, icons, and connector lines.
  • Steps.Trigger, Steps.PrevTrigger, and Steps.NextTrigger are native <button type="button"> elements using the native disabled attribute when inactive or blocked by linear mode.

Keyboard Interactions#

KeyDescription
Tab / Shift+TabMoves focus between enabled step triggers and navigation buttons.
Enter / SpaceActivates the focused trigger or navigation button.