Stepper

Shows where the user is in a multi-step flow such as checkout or onboarding, and lets them move between steps. The stepper only renders the progress; your page renders the active step.

  • vig-stepper
Import
import { Stepper } from '@vigdx/ui/stepper';

Basic

Steps are data: a label and an optional description . Bind [(activeIndex)] and render the panel for it yourself; a template reference gives access to next() and previous() for your own buttons. Every step is clickable.

Enter the email address for your order confirmation.

Linear

With linear the user cannot click past the first incomplete step. Without completedSteps , every step before activeIndex counts as done; pass it to track completion yourself, e.g. once a step's form is valid. next() is not blocked by linear .

Vertical

orientation="vertical" stacks the steps, which suits narrow layouts and timelines. Here the stepper only displays progress.

Icons, errors and disabled steps

icon replaces the step number with a registered icon, error flags a step that needs attention, and disabled steps cannot be visited.

Styling hooks

Internal elements carry a stable data-part and the component's data-scope; both are public API, so removing one is a breaking change. Select a part by both, e.g. [data-scope="stepper"][data-part="list"] { … }: the pair stays within this component when kit components nest, and also reaches parts in overlay panels, which render outside the host. State is exposed through aria-* and, where listed, a data-state; literal values are checked by the API gate, values computed from the component's state follow its documented types. Other data-* attributes listed below (such as data-opening while an overlay animates) are API too. See Customizing.

Scope: [data-scope="stepper"]

Stepper styling hooks
Part Element data-state
list The <ol> of steps. —
step One step <li> . active, complete, error, upcoming, unreachable
control The step button ( aria-current="step" ). —
marker The number, check or icon circle. —
label The step label. —
status The visually hidden state read after the label (", Completed"). —
description The step description. —
connector The line to the next step. —

Accessibility

  • Renders a <nav> landmark named by ariaLabel around an ordered list of step buttons, so the step count and position are announced.
  • The current step carries aria-current="step"; steps that cannot be reached (disabled, or past the first incomplete step when linear) are aria-disabled but stay focusable so their label can still be read.
  • Completed and failed steps append a visually hidden status, overridable with completedLabel and errorLabel for i18n.
  • The stepper does not move focus when the step changes. When your Next button swaps the panel, move focus to the new step's heading or first field.

API

Stepper

vig-stepper component

Progress indicator for a multi-step flow. Steps are data; the consumer renders the panel for activeIndex. Each step is a button in an ordered list: the current one carries aria-current="step", steps that cannot be reached are aria-disabled. With linear, the user cannot jump past the first incomplete step.

Stepper props
Name Type Default Description
activeIndex model number0

Index of the current step; two-way bindable with [(activeIndex)].

ariaLabelstring | undefinedundefined
—
completedLabelstring | undefinedundefined
—
completedStepsreadonly number[] | undefinedundefined

Indices of completed steps. When omitted, every step before activeIndex counts as completed.

errorLabelstring | undefinedundefined
—
linearbooleanfalse

Steps can only be visited up to the first incomplete one.

orientationStepperOrientation'horizontal'

Layout of the steps. horizontal falls back to the vertical layout when the stepper is narrower than 36rem.

stepsreadonly StepperStep[][]
—

Are you sure?