Stepper

Material Design 3-styled stepper / wizard-progress web components (lit-material-stepper, lit-material-step).

  • 3.4 KB gzipped
  • @lit-material/stepper 0.1.0
  • Renders on the server

Example

Install

npm install @lit-material/stepper @lit-material/tokens
import "@lit-material/stepper";

Link @lit-material/tokens/css/index.css once per page for the colour, type and shape tokens. Install guide

API

<lit-material-step>

A single step in a lit-material-stepper — a numbered (or checkmark/error) circle, a connector line to the next step, and a label/description. Purely presentational: it has no click handler of its own — the parent stepper listens for the bubbling click (the same event.composedPath() delegation lit-material-select and lit-material-tab's parent use) and drives active/stepNumber/orientation/roving tabindex from there.

Properties

PropertyAttributeTypeDefaultDescription
activeactivebooleanfalseManaged by the parent stepper: whether this is the currently selected step.
completedcompletedbooleanfalseYours to set — not inferred from active/position. Shows a checkmark instead of the step number.
errorerrorbooleanfalseYours to set. Shows an error indicator instead of the step number, and colors the label.
disableddisabledbooleanfalse
stepNumberstep-numbernumber11-based number shown in the circle. Managed by the parent stepper; defaults to 1 standalone.
orientationorientationStepOrientation"horizontal"Managed by the parent stepper to match its own orientation.

Slots

SlotDescription
labelThe step's label.
descriptionOptional supporting text shown below the label.

CSS parts

PartDescription
stepThe button (background/padding).
rippleThe state-layer element the hover/press feedback is drawn on.
focus-ringThe focus indicator element.
circleThe numbered/checkmark/error indicator circle.
connectorThe line connecting this step to the next one.

<lit-material-stepper>

Groups lit-material-step elements into a wizard-progress indicator, driving each step's active/step-number/orientation and roving-focus keyboard navigation (Left/Right for horizontal, Up/Down for vertical, plus Home/End), marked with aria-current="step" on the active step — the ARIA token defined specifically for step-by-step processes.

Properties

PropertyAttributeTypeDefaultDescription
selectedselectednumber0Index of the active step.
orientationorientationStepOrientation"horizontal"
linearlinearbooleanfalseWhen set, a step is only reachable once every step before it is completed (going back is always allowed).

Events

EventDescription
changeFires when selected changes via user interaction.

Slots

SlotDescription
defaultlit-material-step elements.

CSS parts

PartDescription
stepperThe container.

Source on GitHub npm