Menu

Progress steps

Added in 1.5.0

Progress steps show where the user is in a short flow such as setup or onboarding, with done, active and upcoming steps.

Default markup

Use .progress-steps as the container and .progress-steps-item for each segment.

<ol class="progress-steps" aria-label="Onboarding progress">
  <li class="progress-steps-item"></li>
  <li class="progress-steps-item"></li>
  <li class="progress-steps-item"></li>
</ol>

The default structure:

<ol class="progress-steps" aria-label="Onboarding progress">
  <li class="progress-steps-item"></li>
  <li class="progress-steps-item"></li>
  <li class="progress-steps-item"></li>
  <li class="progress-steps-item"></li>
</ol>

Variants

The variants below use the default .progress-steps markup. They change the state of each step, its label, its color and its width with classes and attributes.

Current and completed step

Add a bg-* class, such as bg-primary, to the completed items and the current item. Set aria-current="step" on the current item.

  1. Step 1
  2. Step 2
  3. Step 3
  4. Step 4
<ol class="progress-steps" aria-label="Setup progress">
  <li class="progress-steps-item bg-primary">
    <span class="visually-hidden">Step 1</span>
  </li>
  <li class="progress-steps-item bg-primary" aria-current="step">
    <span class="visually-hidden">Step 2</span>
  </li>
  <li class="progress-steps-item">
    <span class="visually-hidden">Step 3</span>
  </li>
  <li class="progress-steps-item">
    <span class="visually-hidden">Step 4</span>
  </li>
</ol>

Custom labels

Use hidden labels so assistive technologies can announce meaningful step names.

  1. Account
  2. Profile
  3. Billing
  4. Review
<ol class="progress-steps" aria-label="Checkout progress">
  <li class="progress-steps-item bg-primary">
    <span class="visually-hidden">Account</span>
  </li>
  <li class="progress-steps-item bg-primary">
    <span class="visually-hidden">Profile</span>
  </li>
  <li class="progress-steps-item bg-primary" aria-current="step">
    <span class="visually-hidden">Billing</span>
  </li>
  <li class="progress-steps-item">
    <span class="visually-hidden">Review</span>
  </li>
</ol>

Color state

Use contextual background classes on completed and current items to match the state colors of your flow.

  1. Step 1
  2. Step 2
  1. Step 1
  2. Step 2
  1. Step 1
  2. Step 2
<div class="mb-2">
  <ol class="progress-steps" aria-label="Green progress">
    <li class="progress-steps-item bg-green" aria-current="step">
      <span class="visually-hidden">Step 1</span>
    </li>
    <li class="progress-steps-item">
      <span class="visually-hidden">Step 2</span>
    </li>
  </ol>
</div>
<div class="mb-2">
  <ol class="progress-steps" aria-label="Orange progress">
    <li class="progress-steps-item bg-orange" aria-current="step">
      <span class="visually-hidden">Step 1</span>
    </li>
    <li class="progress-steps-item">
      <span class="visually-hidden">Step 2</span>
    </li>
  </ol>
</div>
<div>
  <ol class="progress-steps" aria-label="Red progress">
    <li class="progress-steps-item bg-red" aria-current="step">
      <span class="visually-hidden">Step 1</span>
    </li>
    <li class="progress-steps-item">
      <span class="visually-hidden">Step 2</span>
    </li>
  </ol>
</div>

Width and layout utilities

Add a width utility, such as .w-50, to .progress-steps to change its width.

  1. Step 1
  2. Step 2
  3. Step 3
  4. Step 4
  5. Step 5
<ol class="progress-steps w-50" id="profile-progress" aria-label="Profile completion">
  <li class="progress-steps-item bg-primary" aria-current="step">
    <span class="visually-hidden">Step 1</span>
  </li>
  <li class="progress-steps-item">
    <span class="visually-hidden">Step 2</span>
  </li>
  <li class="progress-steps-item">
    <span class="visually-hidden">Step 3</span>
  </li>
  <li class="progress-steps-item">
    <span class="visually-hidden">Step 4</span>
  </li>
  <li class="progress-steps-item">
    <span class="visually-hidden">Step 5</span>
  </li>
</ol>

Accessibility

  • Use an <ol> with an aria-label, so screen readers announce a list of steps and the number of items.
  • The segments are empty bars. Put the step name in a visually-hidden span inside each item, or the list is read as empty items.
  • Mark the current step with aria-current="step".
  • The colored segments alone do not say where the user is. Show it in text as well, for example "Step 2 of 4" next to the steps.

Class reference

Every class this component ships, grouped by what it changes. A name in braces stands for a family — {color} is any base color, {breakpoint} any responsive step.

progress-steps componentContainer element
progress-steps-item partOne step segment; add a bg-{color} class to the reached ones

CSS

Variables

The component uses local CSS variables for real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too.

On .progress-steps. Source: core/scss/ui/_progress.scss.

--progress-steps-gap: #{$progress-steps-gap};