GhostDialog reference
Package: @ghostvue/vue. Status: experimental (stability policy).
Headless dialog root provider. Manages controlled/uncontrolled open state via useControllableState, modal mode (trapped focus, scroll lock, inert background siblings, overlay), and deterministic trigger/content/title/description IDs.
Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
defaultOpen | boolean | false | No | Initial open state when `open` is omitted. |
modal | boolean | true | No | Enables modal behavior (trapped focus, scroll lock, inert background, overlay). |
open | boolean | — | No | Controlled open state. Omit for uncontrolled mode. |
Emits
None declared.
Models
| Prop | Event | Type | Description |
|---|---|---|---|
open | update:open | boolean | v-model binding for `open`. |
Slots
| Name | Description |
|---|---|
default | Trigger, overlay, content, title, description, close parts, and optional custom UI reading the scoped state. |
Slot props: default
| Name | Type | Description |
|---|---|---|
close | () => void | Closes the dialog. |
open | boolean | Current open state. |
Exposed members
None declared.
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | trigger | Trigger control rendered by GhostDialogTrigger. |
data-part | overlay | Modal backdrop rendered by GhostDialogOverlay. |
data-part | content | Dialog surface rendered by GhostDialogContent. |
data-part | title | Accessible heading rendered by GhostDialogTitle. |
data-part | description | Accessible description rendered by GhostDialogDescription. |
data-part | close | Close button rendered by GhostDialogClose. |
data-state | open | Applied on data-state across trigger, overlay, and content while the dialog is open. |
data-state | closed | Applied on GhostDialogTrigger data-state while the dialog is closed. |
CSS variables
None declared.
Accessibility
Role: dialog. APG pattern: https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/.
Required ARIA attributes: aria-expanded, aria-controls, aria-haspopup, aria-labelledby.
Keyboard
| Key | Action | Automated browser test |
|---|---|---|
Enter | Opens or toggles the dialog on GhostDialogTrigger or closes on GhostDialogClose. | Not reviewed |
Space | Opens or toggles the dialog on GhostDialogTrigger or closes on GhostDialogClose. | Not reviewed |
Tab | Moves focus forward through tabbable descendants, wrapping within modal dialogs. | Not reviewed |
Shift+Tab | Moves focus backward through tabbable descendants, wrapping within modal dialogs. | Not reviewed |
Escape | Dismisses the topmost open dialog when closeOnEscape is enabled and restores focus. | 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
dialog/basic
Unstyled modal dialog with overlay, trapped Tab focus, scroll lock, and inert background.