GhostCommandPaletteContent reference
Package: @ghostvue/vue. Status: experimental (stability policy).
Dialog surface (role="dialog") composing the shared dialog focus scope, scroll lock, inert background, and dismissal. Focuses the command input on open by default and hosts the polite live region. Unmounted while closed. After logical close it stays mounted with data-state="closed", inert, and pointer-events: none only while its own CSS exit transition or animation runs (useGhostPresence), then unmounts; focus, dismissal, scroll lock, and background inert release immediately.
Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
as | GhostCommandPaletteContentElement | "div" | No | Tag name or component rendered for the dialog surface. |
closeOnEscape | boolean | — | No | Overrides the root `closeOnEscape` when set. |
closeOnOutsideClick | boolean | true | No | Dismisses the palette on outside pointerdown, including the overlay. |
focusReady | boolean | true | No | Gates the first focus-scope activation of each opening. |
initialFocus | (() => HTMLElement | null) | — | No | Resolves the element focused on open; defaults to the command input. |
portal | boolean | true | No | Teleport content through `GhostPortal` when `true`, or render inline when `false`. |
portalTo | GhostPortalTarget | "body" | No | Teleport target passed to `GhostPortal` when `portal` is `true`. |
returnFocus | (() => HTMLElement | null) | — | No | Resolves the element focused on close; invalid or `null` keeps the saved opener. |
Emits
None declared.
Models
None declared.
Slots
| Name | Description |
|---|---|
default | Primary content. |
Slot props: default
None declared.
Exposed members
| Name | Type | Description |
|---|---|---|
blur | () => void | Exposed method `blur`. |
element | HTMLElement | null | Mounted palette surface element while open or exiting; null once unmounted. |
focus | (options?: FocusOptions) => void | Exposed method `focus`. |
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | content | Surface with class ghost-command-palette-content and data-part="content". |
data-part | announcer | Visually hidden polite live region for loading, empty, and result-count messages. |
data-state | open | data-state="open" while mounted. |
data-state | closed | Applied on data-state while the surface plays its exit motion after logical close; the surface is also inert with inline pointer-events: none until it unmounts. |
CSS variables
None declared.
Accessibility
Role: dialog. APG pattern: https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/.
Required ARIA attributes: aria-modal, aria-labelledby.
Keyboard
| Key | Action | Automated browser test |
|---|---|---|
Escape | Closes the palette when closeOnEscape is true and restores focus. | Not reviewed |
Tab | Cycles within a modal palette. | Not reviewed |
Shift+Tab | Cycles backward within a modal palette. | Not reviewed |
Verification
Each category is reviewed separately. Automated keyboard and axe results do not attest manual or assistive-technology review.
| Category | Status | Evidence |
|---|---|---|
| Automated keyboard | Not reviewed | No declared key is mapped to a browser test yet. |
| Manual interaction | Not reviewed | No review recorded. |
| Assistive technology | Not reviewed | No review recorded. |
Examples
None declared.