Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Stepper
  3. API and Development

Stepper

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Import Stepper, StepperOrientation, StepperSelection, and StepperState from @prepared911/ui/stepper. Stepper takes the props below and nothing else: no native attributes, no style.
PropTypeDefaultNotes
stepsreadonly StepperStep[]required with flat layoutMutually exclusive with sections. An empty list renders nothing
sectionsreadonly StepperSection[]required with sectioned layoutHorizontal only; mutually exclusive with steps
sectionSummary(position: { index: number; count: number }) => LocalizedMessageCurrent section only; omitted means no summary line
stateLabelsRecord<StepperState, LocalizedMessage>requiredHidden text read before the label, one entry per state
aria-labelLocalizedMessageName of the list. aria-label or aria-labelledby is required
aria-labelledbystringId of the element that names the list
currentstringId of the current step. Controlled; a value that names no step warns once
announcement(change: StepperChange) => LocalizedMessageThe sentence for a step that became current or complete
classNamestringAppended to the list
idstringId of the list
onStepSelect(id: string) => voidWhen set, selectable steps become buttons with roving keyboard focus
selectionStepperSelectionCompletedAll allows every non-disabled non-current step
orientationStepperOrientationHorizontalVertical for a side rail
compactbooleanfalseHorizontal only: hide non-current labels visually
Below the centered-block width (640px), the stepper applies a container-query fold: markers stay on the track, per-step labels and descriptions hide visually, and the current step label (plus section label when sectioned) appears in a fold footer. The root establishes container-type: inline-size; callers do not need an extra wrapper for the fold.
StepperSection
FieldTypeNotes
idstringRequired
labelLocalizedMessageShown below the section track segment
stepsreadonly StepperStep[]Steps in this section, in order
StepperStep
FieldTypeNotes
idstringRequired; the React key and what current points at
labelLocalizedMessage | DisplayValueRequired
descriptionLocalizedMessageSupporting copy under the label
errorLocalizedMessageAlert copy under the label; progress stays derived from current (A16)
optionalLocalizedMessageMuted suffix after the label
disabledReasonLocalizedMessageStep is not selectable; replaces the description
StepperChange
FieldTypeNotes
stepStepperStepThe step that changed
stateStepperState.Complete | StepperState.CurrentThe state it moved to
StepperState
Complete, Current, Upcoming, Error (hidden label when step.error is set; does not override progress).
Exports
Stepper, StepperState, and the types StepperProps, StepperStep, StepperChange and StepperStateLabels.
Props
NameTypeDefaultDescription
stateLabelsReadonly<Record<StepperState, LocalizedMessage>>——
announcement((change: StepperChange) => LocalizedMessage)——
aria-labelLocalizedMessage——
aria-labelledbystring——
classNamestring—@deprecated Pass layout through enum props and shipped parts. Request a missing case via find-pattern.
compactbooleanfalseHorizontal only: hide non-current labels visually while keeping them in the accessible name.
currentstring—Id of the current step (controlled).
idstring——
onStepSelect((id: string) => void)—When set, completed steps are buttons that call this handler; arrow keys move among them.
orientationStepperOrientation—Sectioned layout is horizontal only (ST-24).
refRef<HTMLOListElement>——
sectionsreadonly StepperSection[]——
sectionSummary((position: { index: number; count: number; }) => LocalizedMessage)—Horizontal sectioned layout only: formats the current step position within its section (for example "Step 2 of 4"). Nothing renders when omitted.
selectionStepperSelectionStepperSelection.CompletedWhich steps become buttons when {@link StepperSharedProps.onStepSelect} is set.
stepsreadonly StepperStep[]——
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
Previous
Stepper / Usage
Next
Stepper / Accessibility
On this page
StepperSection
StepperStep
StepperChange
StepperState
Exports
Props
Storybook