Skip to content

GhostPresence reference ​

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

Renderless presence primitive that decouples logical open state from DOM presence. While present the default slot mounts; when present turns false the slot stays mounted with data-state="closed", inert, and pointer-events: none only while the surface's own finite CSS transitions or animations run, then unmounts. Reopening mid-exit reuses the same node, and stale completions are ignored. Absent motion unmounts in the close flush.

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

All component references

Props ​

NameTypeDefaultRequiredDescription
disabledbooleanfalseNoWhen `true`, bypasses exit waiting and unmounts immediately when `present` turns `false`.
presentboolean—YesLogical open/mounted state. When `true`, mounts the default slot; when `false`, transitions through `exiting` before unmount.

Emits ​

NamePayloadDescription
exitCompletevoidEmitted once when an exit finishes and the slot unmounts. Not emitted when a reopen interrupts the exit, when disabled skips it, or when the owner unmounts.

Models ​

None declared.

Slots ​

NameDescription
defaultContent mounted while present. A single element or component root is decorated automatically; otherwise bind `setElement`, `state`, and `exiting` on the animated surface.

Slot props: default ​

NameTypeDescription
exitingboolean`true` while the exit motion runs; bind `:inert="exiting || undefined"` when binding manually.
phaseGhostPresencePhaseCurrent lifecycle phase.
presentbooleanLogical `present` value passed to the component.
setElement(target: unknown) => voidTemplate-ref setter for the animated surface when the slot is not a single element.
stateGhostPresenceDataStateValue to bind as `data-state` on a surface that binds `setElement` manually.

Exposed members ​

None declared.

Parts and data attributes ​

AttributeValueDescription
data-stateopendata-state="open" injected on a single slot root (unless it sets its own data-state) while present.
data-statecloseddata-state="closed" plus inert and inline pointer-events: none on a single slot root while the exit motion runs.

CSS variables ​

None declared.

Accessibility ​

Role: generic. APG pattern: https://www.w3.org/WAI/ARIA/apg/.

Required ARIA attributes: none.

Keyboard ​

None declared.

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 ​

presence/basic ​

Example source

Inspector panel Headless

A toggled panel that fades out before it unmounts, with focus and state released at once.

Completed exits: 0

presence/portal ​

Example source

Portaled surface Headless

GhostPresence inside GhostPortal, with the slot binding setElement on a multi-root surface.