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.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
closeOnEscape | boolean | true | No | Whether `Escape` closes the palette. |
closeOnSelect | boolean | true | No | Requests close after a command is activated. |
defaultOpen | boolean | false | No | Initial open state when `open` is omitted. |
defaultSearch | string | "" | No | Initial query and the value it resets to on close. |
disabled | boolean | false | No | Blocks opening, search, and command activation. |
loading | boolean | false | No | Loading presentation: hides empty, sets `aria-busy`, announces loading. |
messages | GhostComboboxMessages | — | No | Overrides loading, empty, and results-count announcements. |
modal | boolean | true | No | Modal shell (focus trap, scroll lock, inert background, overlay). |
open | boolean | — | No | Controlled open state. Omit for uncontrolled mode. |
search | string | — | No | Controlled query text. Omit for uncontrolled mode. |
Emits
| Name | Payload | Description |
|---|---|---|
command | GhostCommandPaletteCommandPayload | Emitted synchronously with { id } when an enabled command is activated. Not cancelable; runs before any close request. |
search | GhostComboboxSearchPayload | Emitted after each query change, including the reset on close, with a monotonic requestId for stale-response guards. |
Models
| Prop | Event | Type | Description |
|---|---|---|---|
open | update:open | boolean | v-model binding for `open`. |
search | update:search | string | v-model binding for `search`. |
Slots
| Name | Description |
|---|---|
default | Palette parts composed by the consumer. |
Slot props: default
| Name | Type | Description |
|---|---|---|
close | () => void | Slot prop `close`. |
focusInput | () => void | Slot prop `focusInput`. |
loading | boolean | Slot prop `loading`. |
open | boolean | Slot prop `open`. |
search | string | Slot prop `search`. |
Exposed members
| Name | Type | Description |
|---|---|---|
blur | () => void | Exposed method `blur`. |
close | () => void | Requests close; a controlled parent may keep it open. |
element | HTMLElement | null | Exposed property `element`. |
focus | (options?: FocusOptions) => void | Exposed method `focus`. |
focusInput | () => void | Moves focus to the command input when it is mounted. |
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | trigger | Opener from GhostCommandPaletteTrigger. |
data-part | overlay | Modal backdrop from GhostCommandPaletteOverlay. |
data-part | content | Dialog surface from GhostCommandPaletteContent; hosts the polite announcer. |
data-part | title | Accessible name from GhostCommandPaletteTitle. |
data-part | input | Combobox query field from GhostCommandPaletteInput. |
data-part | list | In-flow listbox from GhostCommandPaletteList. |
data-part | item | Command option from GhostCommandPaletteItem. |
data-part | group | Labelled group from GhostCommandPaletteGroup. |
data-part | label | Group label from GhostCommandPaletteLabel. |
data-part | separator | Decorative divider from GhostCommandPaletteSeparator. |
data-part | empty | Message from GhostCommandPaletteEmpty when open, not loading, and no items are registered. |
data-part | announcer | Visually hidden polite live region inside the content. |
data-state | open | Trigger and input data-state while the palette is open. |
data-state | active | Item data-state (and data-highlighted) for the keyboard or pointer highlight. |
data-state | disabled | Item 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
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
command-palette/basic
Headless palette with static grouped commands, a separator, and consumer-owned filtering.
command-palette/shortcut
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.
command-palette/virtualized
Consumer-driven windowing over 2,000 commands: only a slice of stable ids is mounted at a time.