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.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
ariaLabel | string | "Steps" | No | Accessible name of the `nav` root, or of the list when `navigation` is `none`. |
completeLabel | string | "Completed" | No | Visually hidden status text for a complete, valid step that is not current. |
defaultValue | GhostStepperValue<TStep> | — | No | Initial current step when `modelValue` is omitted. Read once at setup. Omitted, the first step of the current `steps` is current until the user moves. |
disabled | boolean | false | No | No 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) | — | No | Visually hidden text that starts each trigger's accessible name. Return text without trailing punctuation; the stepper adds the separator. |
invalidLabel | string | "Has errors" | No | Visually hidden status text for any invalid step, including the current one. Takes precedence over `completeLabel`. |
modelValue | GhostStepperValue<TStep> | — | No | Controlled current step `value`. Omit for uncontrolled mode. |
navigation | GhostStepperNavigation | "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. |
orientation | GhostStepperOrientation | "horizontal" | No | Layout only. Sets `data-orientation`. |
steps | readonly TStep[] | — | Yes | Ordered steps. `value` must be unique and non-empty. Read, never mutated. |
Emits
None declared.
Models
| Prop | Event | Type | Description |
|---|---|---|---|
modelValue | update:modelValue | GhostStepperValue<TStep> | v-model binding for `modelValue`. |
Slots
| Name | Description |
|---|---|
description | Supporting text outside the trigger, referenced by `aria-describedby`. Defaults to `step.description`. When provided, it renders for every step. Receives the step context. |
indicator | Decoration 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`, …). |
label | Visible label inside the trigger. Must render text: it is part of the trigger's accessible name. Receives the step context. |
separator | Decoration 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
| Name | Type | Description |
|---|---|---|
blur | () => void | Blurs the focused trigger. |
element | HTMLElement | null | Root element after mount; `null` before mount. |
focus | (options?: FocusOptions) => void | Focuses 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
| Attribute | Value | Description |
|---|---|---|
data-part | root | nav landmark named by ariaLabel; a div when navigation is none. Consumer class, style and attributes land here. |
data-part | list | Ordered list of steps (ol). Named by ariaLabel when navigation is none. Flex row or column with no markers. |
data-part | item | List item for one step. Carries the step's state attributes. |
data-part | trigger | Native button (a span when navigation is none) whose accessible name is the position, label and status text. |
data-part | indicator | aria-hidden decoration inside the trigger: the position, a check for a complete step, ! for an invalid one, or the indicator slot. |
data-part | position | Visually hidden "Step N of M, " text that starts the trigger's accessible name. |
data-part | label | Visible step label inside the trigger, or the label slot. |
data-part | status | Visually hidden ", Completed" or ", Has errors" text after the label. Absent for a current valid step and for incomplete steps. |
data-part | description | Supporting text after the trigger, referenced by aria-describedby. Not rendered when the step has none and no description slot is given. |
data-part | separator | aria-hidden part after every item except the last; themes draw the connector line here. |
data-state | complete | data-state on an item and trigger whose step is completed and not current. |
data-state | current | data-state on the current step's item and trigger. |
data-state | incomplete | data-state on every other step: upcoming steps and earlier steps not marked complete. |
data-orientation | horizontal, vertical | On the root. Layout only. |
data-navigation | linear, free, none | On the root. |
data-disabled | present | On the root when disabled; on an item and its trigger when the step or the root is disabled. |
data-completed | present | On an item and trigger whose step is completed, including a current step the user finished before going back. |
data-invalid | present | On an item and trigger whose step holds errors. |
data-navigable | present | On 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
Verification
Each category is reviewed separately. Automated keyboard and axe results do not attest manual or assistive-technology review.
| Category | Status | Evidence |
|---|---|---|
| Automated keyboard | Passed | Every declared key maps to a Chromium browser test that CI runs and requires to pass on every commit. |
| Manual interaction | Not reviewed | No review recorded. |
| Assistive technology | Not reviewed | No review recorded. |
Examples
stepper/custom-indicator
Headless stepper with icon indicators and two-line labels from the indicator and label slots, styled with data-part hooks.