GhostDrawer reference
Package: @ghostvue/vue. Status: experimental (stability policy).
Headless edge-anchored drawer (sheet) root provider built as a GhostDialog variant. Manages controlled/uncontrolled open state via useControllableState, modal mode (trapped focus, scroll lock, inert background siblings, overlay), logical side placement (start, end, top, bottom), optional writing direction, and deterministic ghost-drawer-* part 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. |
dir | GhostDrawerDirection | — | No | Explicit writing direction for mapping logical `start` / `end` sides. |
modal | boolean | true | No | Enables modal behavior (trapped focus, scroll lock, inert background, overlay). |
open | boolean | — | No | Controlled open state. Omit for uncontrolled mode. |
side | GhostDrawerSide | "end" | No | Viewport edge the drawer is anchored to (`'start'`, `'end'`, `'top'`, `'bottom'`). |
Emits
None declared.
Models
| Prop | Event | Type | Description |
|---|---|---|---|
open | update:open | boolean | v-model binding for `open`. |
Slots
| Name | Description |
|---|---|
default | Drawer trigger, overlay, content, title, description, and close parts. |
Slot props: default
| Name | Type | Description |
|---|---|---|
close | () => void | Closes the drawer. |
open | boolean | Current open state. |
side | GhostDrawerSide | Slot prop `side`. |
Exposed members
None declared.
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | trigger | Trigger control rendered by GhostDrawerTrigger. |
data-part | overlay | Modal backdrop rendered by GhostDrawerOverlay. |
data-part | content | Drawer surface rendered by GhostDrawerContent. |
data-part | title | Accessible heading rendered by GhostDrawerTitle. |
data-part | description | Accessible description rendered by GhostDrawerDescription. |
data-part | close | Close button rendered by GhostDrawerClose. |
data-state | open | Applied on data-state across trigger, overlay, and content while the drawer is open. |
data-state | closed | Applied on GhostDrawerTrigger data-state while the drawer is closed. |
data-state | side | data-side="start" | "end" | "top" | "bottom" on trigger, overlay, and content reports the effective side. |
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 drawer on GhostDrawerTrigger or closes on GhostDrawerClose. | Not reviewed |
Space | Opens or toggles the drawer on GhostDrawerTrigger or closes on GhostDrawerClose. | Not reviewed |
Tab | Moves focus forward through tabbable descendants, wrapping within modal drawers. | Not reviewed |
Shift+Tab | Moves focus backward through tabbable descendants, wrapping within modal drawers. | Not reviewed |
Escape | Dismisses the topmost open drawer 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
drawer/basic
Unstyled end-side modal drawer with overlay, trapped Tab focus, scroll lock, and inert background.