Skip to content

Stepper

The bq-stepper component shows progress through a multi-step flow such as a checkout or onboarding wizard.

Basic Usage

Steps are declared as light-DOM children carrying data-step:

html
<bq-stepper current="1">
  <div data-step label="Account"></div>
  <div data-step label="Shipping"></div>
  <div data-step label="Payment"></div>
</bq-stepper>

current is a zero-based index: everything before it is complete, the step at that index is current, the rest are upcoming.

Descriptions

html
<bq-stepper current="0">
  <div data-step label="Account" description="Your details"></div>
  <div data-step label="Shipping" description="Where it goes"></div>
  <div data-step label="Payment" description="How you pay"></div>
</bq-stepper>

Orientation

html
<bq-stepper current="1" orientation="vertical">
  <div data-step label="Account"></div>
  <div data-step label="Shipping"></div>
  <div data-step label="Payment"></div>
</bq-stepper>

Clickable Steps

With clickable, each step renders as a button and emits bq-step-change when activated:

html
<bq-stepper current="2" clickable>
  <div data-step label="Account"></div>
  <div data-step label="Shipping"></div>
  <div data-step label="Payment"></div>
</bq-stepper>
js
stepper.addEventListener('bq-step-change', (event) => {
  console.log(event.detail); // { index: 0, label: 'Account' }
});

Add disabled to a step to keep it unreachable:

html
<div data-step label="Payment" disabled></div>

Properties

PropertyTypeDefaultDescription
currentnumber0Zero-based index of the active step
orientationstring'horizontal'horizontal | vertical
clickablebooleanfalseRender steps as buttons
labelstring''Accessible label for the step list

Step Attributes

AttributeDescription
data-stepMarks the element as a step (required)
labelStep title
descriptionSecondary text under the title
disabledPrevents activation when clickable is set

Events

EventDetailDescription
bq-step-change{ index: number, label: string }A clickable step was activated

CSS Parts

PartDescription
stepperThe stepper container
stepAn individual step
markerThe numbered/checked circle
labelStep title
descriptionStep description

Accessibility

  • The active step carries aria-current="step".
  • Each step includes visually hidden status text (Completed, Current step, Upcoming step) so its state is not conveyed by colour alone.
  • A polite live region announces Step N of M as current changes.
  • Step markers are aria-hidden; the label carries the accessible name.
  • Steps are read from the light DOM and kept in sync with a MutationObserver, so steps can be added or relabelled at runtime.

Released under the MIT License.