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.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
disabled | boolean | false | No | When `true`, bypasses exit waiting and unmounts immediately when `present` turns `false`. |
present | boolean | — | Yes | Logical open/mounted state. When `true`, mounts the default slot; when `false`, transitions through `exiting` before unmount. |
Emits
| Name | Payload | Description |
|---|---|---|
exitComplete | void | Emitted 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
| Name | Description |
|---|---|
default | Content 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
| Name | Type | Description |
|---|---|---|
exiting | boolean | `true` while the exit motion runs; bind `:inert="exiting || undefined"` when binding manually. |
phase | GhostPresencePhase | Current lifecycle phase. |
present | boolean | Logical `present` value passed to the component. |
setElement | (target: unknown) => void | Template-ref setter for the animated surface when the slot is not a single element. |
state | GhostPresenceDataState | Value to bind as `data-state` on a surface that binds `setElement` manually. |
Exposed members
None declared.
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-state | open | data-state="open" injected on a single slot root (unless it sets its own data-state) while present. |
data-state | closed | data-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.
| 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
presence/basic
A toggled panel that fades out before it unmounts, with focus and state released at once.
presence/portal
GhostPresence inside GhostPortal, with the slot binding setElement on a multi-root surface.