Skip to main content

Stepper

Steps of a process, such as a sign-up flow or checkout, laid out vertically or in a row.

Bootstrap’s stepper docs describe the markup and CSS.

Example

Bind the current step with [(step)], starting at 0. Steps up to and including it are marked done, and the current one gets aria-current="step". next() and previous() move between steps.

  1. Create account
  2. Confirm email
  3. Update profile
  4. Finish
<ol bsStepper #stepper="bsStepper" [(step)]="step" horizontal>
  <li bsStepperItem>Create account</li>
  <li bsStepperItem>Confirm email</li>
  <li bsStepperItem>Update profile</li>
  <li bsStepperItem>Finish</li>
</ol>
<div class="hstack gap-2 mt-3">
  <button type="button" bsButton="outline" theme="secondary" (click)="stepper.previous()">
    Back
  </button>
  <button type="button" bsButton theme="primary" (click)="stepper.next()">Next</button>
</div>

Vertical and responsive

Steppers are vertical by default. Set horizontal to a breakpoint to lay them out in a row from there up; the responsive variants use container queries, so wrap the stepper in .contains-inline.

  1. Create account
  2. Confirm email
  3. Update profile
HTML
<div class="contains-inline">
  <ol bsStepper [step]="1" horizontal="md">
    <li bsStepperItem>Create account</li>
    <li bsStepperItem>Confirm email</li>
    <li bsStepperItem>Update profile</li>
  </ol>
</div>

Themes

Set theme on a step to color it.

  1. Create account
  2. Confirm email
  3. Update profile
  4. Payment failed
HTML
<ol bsStepper [step]="3" horizontal>
  <li bsStepperItem theme="accent">Create account</li>
  <li bsStepperItem theme="success">Confirm email</li>
  <li bsStepperItem theme="success">Update profile</li>
  <li bsStepperItem theme="danger">Payment failed</li>
</ol>

API

BsStepper

Selector: [bsStepper] · Exported as: bsStepper

Inputs

NameTypeDefaultDescription
stepnumber0Index of the current step. Supports [(step)].
horizontalboolean | 'sm' | 'md' | 'lg' | 'xl' | '2xl'falseLays the steps out in a row, from a breakpoint up.

Outputs

NameTypeDescription
stepChangenumberEmits the new step.

Methods

NameTypeDescription
next()voidGoes to the next step.
previous()voidGoes to the previous step.
countSignal<number>Number of steps.

BsStepperItem

Selector: [bsStepperItem]

Inputs

NameTypeDefaultDescription
themeBsTheme | nullnullTheme color of the step.