Axon 911 Frontend DocsAxon 911 Frontend Docs
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, StepperState from @prepared911/ui/stepper. Stepper takes the props below and nothing else: no native attributes, no style.
PropTypeDefaultNotes
stepsreadonly StepperStep[]requiredThe steps, in order. An empty list renders nothing
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
refRef<HTMLOListElement>The list element
StepperStep
FieldTypeNotes
idstringRequired; the React key and what current points at
labelLocalizedMessage | DisplayValueRequired
stateStepperStateWins over the state derived from current
StepperChange
FieldTypeNotes
stepStepperStepThe step that changed
stateStepperState.Complete | StepperState.CurrentThe state it moved to
StepperState
Complete, Current, Upcoming, NeedsConfirmation.
Exports
Stepper, StepperState, and the types StepperProps, StepperStep, StepperChange and StepperStateLabels.
Props
NameTypeDefaultDescription
stateLabelsReadonly<Record<StepperState, LocalizedMessage>>——
stepsreadonly StepperStep[]——
announcement((change: StepperChange) => LocalizedMessage)——
aria-labelLocalizedMessage——
aria-labelledbystring——
classNamestring——
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——
refRef<HTMLOListElement>——
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
StepperStep
StepperChange
StepperState
Exports
Props
Storybook