Skip to content

GhostCommandPalette reference ​

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

Headless command palette root: a GhostDialog shell composed with useGhostCombobox for grouped, consumer-filtered commands, keyboard highlight, loading and empty announcements, and a command event carrying the activated item id. Renders no element.

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

All component references

Props ​

NameTypeDefaultRequiredDescription
closeOnEscapebooleantrueNoWhether `Escape` closes the palette.
closeOnSelectbooleantrueNoRequests close after a command is activated.
defaultOpenbooleanfalseNoInitial open state when `open` is omitted.
defaultSearchstring""NoInitial query and the value it resets to on close.
disabledbooleanfalseNoBlocks opening, search, and command activation.
loadingbooleanfalseNoLoading presentation: hides empty, sets `aria-busy`, announces loading.
messagesGhostComboboxMessages—NoOverrides loading, empty, and results-count announcements.
modalbooleantrueNoModal shell (focus trap, scroll lock, inert background, overlay).
openboolean—NoControlled open state. Omit for uncontrolled mode.
searchstring—NoControlled query text. Omit for uncontrolled mode.

Emits ​

NamePayloadDescription
commandGhostCommandPaletteCommandPayloadEmitted synchronously with { id } when an enabled command is activated. Not cancelable; runs before any close request.
searchGhostComboboxSearchPayloadEmitted after each query change, including the reset on close, with a monotonic requestId for stale-response guards.

Models ​

PropEventTypeDescription
openupdate:openbooleanv-model binding for `open`.
searchupdate:searchstringv-model binding for `search`.

Slots ​

NameDescription
defaultPalette parts composed by the consumer.

Slot props: default ​

NameTypeDescription
close() => voidSlot prop `close`.
focusInput() => voidSlot prop `focusInput`.
loadingbooleanSlot prop `loading`.
openbooleanSlot prop `open`.
searchstringSlot prop `search`.

Exposed members ​

NameTypeDescription
blur() => voidExposed method `blur`.
close() => voidRequests close; a controlled parent may keep it open.
elementHTMLElement | nullExposed property `element`.
focus(options?: FocusOptions) => voidExposed method `focus`.
focusInput() => voidMoves focus to the command input when it is mounted.

Parts and data attributes ​

AttributeValueDescription
data-parttriggerOpener from GhostCommandPaletteTrigger.
data-partoverlayModal backdrop from GhostCommandPaletteOverlay.
data-partcontentDialog surface from GhostCommandPaletteContent; hosts the polite announcer.
data-parttitleAccessible name from GhostCommandPaletteTitle.
data-partinputCombobox query field from GhostCommandPaletteInput.
data-partlistIn-flow listbox from GhostCommandPaletteList.
data-partitemCommand option from GhostCommandPaletteItem.
data-partgroupLabelled group from GhostCommandPaletteGroup.
data-partlabelGroup label from GhostCommandPaletteLabel.
data-partseparatorDecorative divider from GhostCommandPaletteSeparator.
data-partemptyMessage from GhostCommandPaletteEmpty when open, not loading, and no items are registered.
data-partannouncerVisually hidden polite live region inside the content.
data-stateopenTrigger and input data-state while the palette is open.
data-stateactiveItem data-state (and data-highlighted) for the keyboard or pointer highlight.
data-statedisabledItem data-state when it cannot be highlighted or activated.

CSS variables ​

None declared.

Accessibility ​

Role: dialog. APG pattern: https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-autocomplete-list/.

Required ARIA attributes: aria-modal, aria-labelledby, aria-expanded, aria-controls, aria-autocomplete, aria-activedescendant.

Keyboard ​

KeyActionAutomated browser test
ArrowDownHighlights the next enabled command (wraps) and updates aria-activedescendant on the input.GhostCommandPalette › command-palette/basic: keyboard-only activation, grouped labels, Tab trap, empty state, focus restore, and axe (@ghostvue/vue)
ArrowUpHighlights the previous enabled command (wraps).GhostCommandPalette › command-palette/basic: keyboard-only activation, grouped labels, Tab trap, empty state, focus restore, and axe (@ghostvue/vue)
HomeHighlights the first enabled command.GhostCommandPalette › command-palette/basic: keyboard-only activation, grouped labels, Tab trap, empty state, focus restore, and axe (@ghostvue/vue)
EndHighlights the last enabled command.GhostCommandPalette › command-palette/basic: keyboard-only activation, grouped labels, Tab trap, empty state, focus restore, and axe (@ghostvue/vue)
EnterActivates the highlighted command: emits command with its id and, with closeOnSelect, closes. Never commits a selection or rewrites the query.GhostCommandPalette › command-palette/basic: keyboard-only activation, grouped labels, Tab trap, empty state, focus restore, and axe (@ghostvue/vue)
EscapeClears the highlight and closes the palette when closeOnEscape is true; focus returns to the opener.GhostCommandPalette › command-palette/basic: keyboard-only activation, grouped labels, Tab trap, empty state, focus restore, and axe (@ghostvue/vue)
TabCycles within the modal palette; in a non-modal palette, leaving the palette closes it without restoring focus.GhostCommandPalette › command-palette/basic: keyboard-only activation, grouped labels, Tab trap, empty state, focus restore, and axe (@ghostvue/vue)
GhostCommandPalette › non-modal palette closes when Tab leaves it, without pulling focus back (C4) (@ghostvue/themes)
Shift+TabCycles backward within the modal palette; in a non-modal palette, leaving closes it like Tab.GhostCommandPalette › command-palette/basic: keyboard-only activation, grouped labels, Tab trap, empty state, focus restore, and axe (@ghostvue/vue)
GhostCommandPalette › non-modal palette closes when Tab leaves it, without pulling focus back (C4) (@ghostvue/themes)

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 ​

command-palette/basic ​

Example source

Basic Headless

Headless palette with static grouped commands, a separator, and consumer-owned filtering.

Last command: None yet

command-palette/shortcut ​

Example source

Keyboard shortcut Headless

Headless palette opened by an app-owned Mod+J listener from a non-trigger opener; focus returns to that opener. The palette registers no global listener.

Press Ctrl+J anywhere on this page to open the formatting commands.

Last command: None yet

command-palette/virtualized ​

Example source

Large command sets Headless

Consumer-driven windowing over 2,000 commands: only a slice of stable ids is mounted at a time.

Opened: Nothing yet