Skip to content

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.

All component references

Props ​

NameTypeDefaultRequiredDescription
defaultOpenbooleanfalseNoInitial open state when `open` is omitted.
modalbooleantrueNoEnables modal behavior (trapped focus, scroll lock, inert background, overlay).
openboolean—NoControlled open state. Omit for uncontrolled mode.

Emits ​

None declared.

Models ​

PropEventTypeDescription
openupdate:openbooleanv-model binding for `open`.

Slots ​

NameDescription
defaultTrigger, overlay, content, title, description, close parts, and optional custom UI reading the scoped state.

Slot props: default ​

NameTypeDescription
close() => voidCloses the dialog.
openbooleanCurrent open state.

Exposed members ​

None declared.

Parts and data attributes ​

AttributeValueDescription
data-parttriggerTrigger control rendered by GhostDialogTrigger.
data-partoverlayModal backdrop rendered by GhostDialogOverlay.
data-partcontentDialog surface rendered by GhostDialogContent.
data-parttitleAccessible heading rendered by GhostDialogTitle.
data-partdescriptionAccessible description rendered by GhostDialogDescription.
data-partcloseClose button rendered by GhostDialogClose.
data-stateopenApplied on data-state across trigger, overlay, and content while the dialog is open.
data-stateclosedApplied 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 ​

KeyActionAutomated browser test
EnterOpens or toggles the dialog on GhostDialogTrigger or closes on GhostDialogClose.Not reviewed
SpaceOpens or toggles the dialog on GhostDialogTrigger or closes on GhostDialogClose.Not reviewed
TabMoves focus forward through tabbable descendants, wrapping within modal dialogs.Not reviewed
Shift+TabMoves focus backward through tabbable descendants, wrapping within modal dialogs.Not reviewed
EscapeDismisses 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.

CategoryStatusEvidence
Automated keyboardNot reviewedNo declared key is mapped to a browser test yet.
Manual interactionNot reviewedNo review recorded.
Assistive technologyNot reviewedNo review recorded.

Examples ​

dialog/basic ​

Example source

Basic Headless

Unstyled modal dialog with overlay, trapped Tab focus, scroll lock, and inert background.