Skip to content

Stepper ​

catnip-stepper communicates progress through a finite, ordered process. It supports horizontal and vertical layouts, optional step names, completed connectors, four semantic intents, an independent active state, and opt-in step navigation.

The component owns the ordered-list structure, current-step semantics, marker and connector presentation, keyboard-operable buttons in interactive mode, and the step-click request event. The consumer owns process state, validation messages, whether navigation is permitted, and updating the steps data after a request.

Live example ​

Basic use ​

Pass steps as a JavaScript property. Each item can provide value, stepName, intent, activeStep, disabled, and ariaLabel:

vue
<catnip-stepper
  .steps="[
    { value: 'account', stepName: 'Account', intent: 'completed', activeStep: false },
    { value: 'identity', stepName: 'Identity', intent: 'default', activeStep: true },
    { value: 'review', stepName: 'Review', intent: 'default' }
  ]"
  .showStepsName="true"
  stepper-aria-label="Account setup progress"
/>

Plain HTML can use a JSON steps attribute. Framework consumers should prefer a property binding so arrays are not stringified accidentally.

Layout and names ​

  • Step names are hidden by default. Set showStepsName to true to display them. When names are shown, every step must provide a non-empty stepName; otherwise the component logs a warning in every environment.
  • orientation="horizontal" is the default. stepNamePosition="horizontal" places a shown name beside the marker; vertical places it below the marker.
  • Horizontal layout preserves full names, markers, and connectors whenever they fit. When the complete sequence no longer fits, labelled previous/next icon buttons appear instead of progressively shortening every name. They move the visible range by one step and replace reliance on an exposed scrollbar.
  • Only an individual name that exceeds its maximum step width is truncated with an ellipsis. Its complete value remains in the native title tooltip and in the accessible step label.
  • orientation="vertical" always places a name beside its marker. A development warning explains that stepNamePosition="vertical" is ignored in this orientation.
  • Connectors preserve the design-system spacing between adjacent markers in vertical layouts and in horizontal layouts without visible names.
  • When showStepsName is false, names remain available to assistive technologies but only the numbered or intent marker is rendered. Leave stepNamePosition unset; the docs playground exposes this omitted value as (none). An explicitly selected position produces a development warning because it has no visual effect in this mode.

Interactive navigation ​

The default stepper is read-only progress content. Set interactive only when users are allowed to move among steps. Enabled steps then become native buttons:

vue
<catnip-stepper .steps="steps" .interactive="true" .showStepsName="true" stepper-aria-label="Checkout steps" @step-click="onStepClick" />

Read event.detail[0] in Vue custom-element usage; it contains { index, value, step, steps }. The component immediately marks the clicked item active and clears active state from every other item. Use the emitted steps array to synchronize controlled application state, then validate, navigate, or reveal the requested content. Disabled steps use the native disabled state and do not emit.

Guidelines ​

Use Stepper for a finite process ​

Use Stepper when users benefit from seeing their position in a linear, multi-step task such as account setup, checkout, or a guided form. Use catnip-progress for numeric completion without named stages, Tabs for switching peer content, and Breadcrumbs or ordinary links for page hierarchy.

Keep the number of visible steps manageable. Prefer short, distinct names and preserve the same order throughout the flow. On narrow screens, use the vertical layout or hide names when the surrounding heading already explains the current stage.

State model ​

  • default: not started or no special state.
  • completed: successfully completed. It fills the connector to the next step.
  • warning: the completed step needs attention but the flow may still continue.
  • danger: the completed step contains a blocking error or failed outcome.

Use activeStep: true for the currently displayed step. Active state is separate from intent: for example, an active warning step keeps its warning icon and colour while receiving the selected two-pixel marker border and semibold label treatment. Supply at most one active item. If multiple items are marked active, the first is used and a development warning is logged.

The connector after completed, warning, or danger is filled because all three states represent a step the user has completed. The connector after default remains unfilled, whether or not that step is active.

Do not infer completed only because a user visited a step. Mark it completed after the completion criteria for that step have passed. Do not use warning or danger without nearby text that explains what needs attention.

Static versus interactive ​

Prefer the static default when progress is informational and navigation is handled by Back and Continue actions. Enable interactive only if selecting a step is genuinely supported.

When interactive:

  • Keep inaccessible future destinations disabled, rather than accepting a click and silently doing nothing.
  • Do not disable completed steps merely because they are complete; users often need to review them.
  • Read the updated steps array from step-click and synchronize it into consumer state. The component makes the clicked step active immediately; consumers remain responsible for validation, routing, and persistent state.

Responsive layout ​

Horizontal steppers preserve complete names, markers, and connectors whenever the sequence fits. When it does not fit, the component keeps each normal-length name intact and enables horizontal step controls instead of shortening every label. Names below markers stay centered without changing the connector lane. Connectors retain an 8px gap from adjacent step content when names sit beside markers and from each marker when names are hidden; vertical layouts preserve the same marker-to-connector separation.

An exceptionally long individual name is capped and ellipsized so its marker and name can still be brought into the viewport together. Its full value remains the accessible name and is exposed through the native title tooltip on hover or supported touch interaction.

Below the width needed for the complete sequence, the component exposes labelled previous/next buttons and scrolls by step. Do not place the component inside another horizontal scroller. Switch to vertical layout when users need to compare every full step name simultaneously. Hidden names remain available through generated accessible step labels; provide ariaLabel on individual steps when the fallback Step N is not specific enough for an interactive destination.

Set showStepsName only when every step has a concise, non-empty stepName. When names are not useful or space is especially constrained, keep showStepsName false and omit stepNamePosition; an explicitly selected position has no visual effect and produces a development warning.

Catnip Design System by Signicat