Skip to content

GhostStepper reference ​

Package: @ghostvue/vue. Status: experimental (stability policy).

Data-driven step indicator for multi-step tasks such as a booking wizard: a nav landmark with an ordered list of native buttons, "Step N of M", label and status text in each trigger's accessible name, aria-current="step" on the current step, and a linear reachability rule (earlier steps, completed steps, and the first step that is neither completed nor disabled). navigation="none" renders a status display with nothing focusable. The app owns step content, validation and what complete means; useGhostStepper exposes the resolved step model for custom markup.

Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.

All component references

Props ​

NameTypeDefaultRequiredDescription
ariaLabelstring"Steps"NoAccessible name of the `nav` root, or of the list when `navigation` is `none`.
completeLabelstring"Completed"NoVisually hidden status text for a complete, valid step that is not current.
defaultValueGhostStepperValue<TStep>—NoInitial current step when `modelValue` is omitted. Read once at setup. Omitted, the first step of the current `steps` is current until the user moves.
disabledbooleanfalseNoNo trigger is navigable; states and the current step stay announced. For a stepper unavailable for the whole task, not for a pending move.
getPositionLabel((position: number, count: number) => string)—NoVisually hidden text that starts each trigger's accessible name. Return text without trailing punctuation; the stepper adds the separator.
invalidLabelstring"Has errors"NoVisually hidden status text for any invalid step, including the current one. Takes precedence over `completeLabel`.
modelValueGhostStepperValue<TStep>—NoControlled current step `value`. Omit for uncontrolled mode.
navigationGhostStepperNavigation"linear"No`linear`: back to any earlier step, to completed steps, and to the first step that is neither completed nor disabled. `free`: every enabled step. `none`: status only; nothing is interactive.
orientationGhostStepperOrientation"horizontal"NoLayout only. Sets `data-orientation`.
stepsreadonly TStep[]—YesOrdered steps. `value` must be unique and non-empty. Read, never mutated.

Emits ​

None declared.

Models ​

PropEventTypeDescription
modelValueupdate:modelValueGhostStepperValue<TStep>v-model binding for `modelValue`.

Slots ​

NameDescription
descriptionSupporting text outside the trigger, referenced by `aria-describedby`. Defaults to `step.description`. When provided, it renders for every step. Receives the step context.
indicatorDecoration inside the trigger's `aria-hidden` indicator part. Defaults to the position, `✓` for a complete valid step, and `!` for an invalid one. Receives the step context (`step`, `position`, `state`, `navigable`, …).
labelVisible label inside the trigger. Must render text: it is part of the trigger's accessible name. Receives the step context.
separatorDecoration after every item except the last, `aria-hidden`. The theme draws the connector line on this part. Receives the step context.

Slot props: description ​

None declared.

Slot props: indicator ​

None declared.

Slot props: label ​

None declared.

Slot props: separator ​

None declared.

Exposed members ​

NameTypeDescription
blur() => voidBlurs the focused trigger.
elementHTMLElement | nullRoot element after mount; `null` before mount.
focus(options?: FocusOptions) => voidFocuses the current step's trigger when it is enabled, otherwise the first enabled trigger. Does nothing when no trigger is enabled.

Parts and data attributes ​

AttributeValueDescription
data-partrootnav landmark named by ariaLabel; a div when navigation is none. Consumer class, style and attributes land here.
data-partlistOrdered list of steps (ol). Named by ariaLabel when navigation is none. Flex row or column with no markers.
data-partitemList item for one step. Carries the step's state attributes.
data-parttriggerNative button (a span when navigation is none) whose accessible name is the position, label and status text.
data-partindicatoraria-hidden decoration inside the trigger: the position, a check for a complete step, ! for an invalid one, or the indicator slot.
data-partpositionVisually hidden "Step N of M, " text that starts the trigger's accessible name.
data-partlabelVisible step label inside the trigger, or the label slot.
data-partstatusVisually hidden ", Completed" or ", Has errors" text after the label. Absent for a current valid step and for incomplete steps.
data-partdescriptionSupporting text after the trigger, referenced by aria-describedby. Not rendered when the step has none and no description slot is given.
data-partseparatoraria-hidden part after every item except the last; themes draw the connector line here.
data-statecompletedata-state on an item and trigger whose step is completed and not current.
data-statecurrentdata-state on the current step's item and trigger.
data-stateincompletedata-state on every other step: upcoming steps and earlier steps not marked complete.
data-orientationhorizontal, verticalOn the root. Layout only.
data-navigationlinear, free, noneOn the root.
data-disabledpresentOn the root when disabled; on an item and its trigger when the step or the root is disabled.
data-completedpresentOn an item and trigger whose step is completed, including a current step the user finished before going back.
data-invalidpresentOn an item and trigger whose step holds errors.
data-navigablepresentOn an item and trigger the user can move to right now.

CSS variables ​

None declared.

Accessibility ​

Role: navigation. APG pattern: https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/.

Required ARIA attributes: aria-label, aria-current.

Keyboard ​

KeyActionAutomated browser test
TabMoves to the next enabled trigger, then on through the page. Disabled (unreachable) steps are skipped. No roving tabindex or arrow keys.GhostStepper @component:GhostStepper › keyboard: Tab and Shift+Tab visit the enabled triggers in order; Enter and Space activate (@ghostvue/vue)
GhostStepper @component:GhostStepper › RTL: the horizontal layout mirrors and Tab follows DOM order (@ghostvue/vue)
Shift+TabMoves to the previous enabled trigger, then back through the page.GhostStepper @component:GhostStepper › keyboard: Tab and Shift+Tab visit the enabled triggers in order; Enter and Space activate (@ghostvue/vue)
GhostStepper @component:GhostStepper › RTL: the horizontal layout mirrors and Tab follows DOM order (@ghostvue/vue)
EnterActivates the focused trigger (native button): emits update:modelValue for a navigable step that is not current. No-op on the current step. Focus stays on the trigger.GhostStepper @component:GhostStepper › keyboard: Tab and Shift+Tab visit the enabled triggers in order; Enter and Space activate (@ghostvue/vue)
GhostStepper @component:GhostStepper › booking wizard: focus stays on the activated trigger while an async move is pending (@ghostvue/vue)
SpaceSame as Enter.GhostStepper @component:GhostStepper › keyboard: Tab and Shift+Tab visit the enabled triggers in order; Enter and Space activate (@ghostvue/vue)

Verification ​

Each category is reviewed separately. Automated keyboard and axe results do not attest manual or assistive-technology review.

CategoryStatusEvidence
Automated keyboardPassedEvery declared key maps to a Chromium browser test that CI runs and requires to pass on every commit.
Manual interactionNot reviewedNo review recorded.
Assistive technologyNot reviewedNo review recorded.

Examples ​

stepper/custom-indicator ​

Example source

Custom indicator Headless

Headless stepper with icon indicators and two-line labels from the indicator and label slots, styled with data-part hooks.