GhostDrawer reference
Package: @ghostvue/themes. Status: experimental (stability policy).
Themed wrappers around headless GhostDrawer, GhostDrawerTrigger, GhostDrawerOverlay, GhostDrawerContent, GhostDrawerTitle, GhostDrawerDescription, and GhostDrawerClose. Importing from @ghostvue/themes loads the default elevation-4 edge panel, scrim, and reduced-motion-aware slide entry stylesheet.
Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
open | boolean | — | No | Controlled open state forwarded to headless GhostDrawer. |
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). |
side | GhostDrawerSide | "end" | No | Viewport edge forwarded to headless GhostDrawer ('start', 'end', 'top', 'bottom'). |
dir | GhostDrawerDirection | — | No | Explicit writing direction for mapping logical start/end sides. |
Emits
None declared.
Models
| Prop | Event | Type | Description |
|---|---|---|---|
open | update:open | boolean | v-model:open binding for controlled state. |
Slots
| Name | Description |
|---|---|
default | Drawer trigger, overlay, content, title, description, and close parts. |
Slot props: default
| Name | Type | Description |
|---|---|---|
open | boolean | Current open state. |
close | () => void | Closes the drawer. |
side | GhostDrawerSide | Effective side. |
Exposed members
None declared.
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | trigger | Trigger control rendered by GhostDrawerTrigger. |
data-part | overlay | Full-viewport backdrop rendered by GhostDrawerOverlay with data-themed. |
data-part | content | Edge-anchored elevation-4 drawer surface rendered by GhostDrawerContent with data-themed; positioned from data-side and data-dir. |
data-part | title | Accessible heading rendered by GhostDrawerTitle. |
data-part | description | Muted supporting description rendered by GhostDrawerDescription. |
data-part | close | Close control rendered by GhostDrawerClose. |
data-state | open | Applied to trigger, overlay, and content while open. |
data-state | closed | Applied to trigger while closed. |
data-state | side | data-side on trigger, overlay, and content selects the anchored edge. |
CSS variables
| Name | Description |
|---|---|
--ghost-scrim | Shared semantic backdrop color of GhostDrawerOverlay, supplied by the theme. |
--ghost-elevation-4-bg | Surface background color of GhostDrawerContent. |
--ghost-elevation-4-border | Border color of GhostDrawerContent. |
--ghost-elevation-4-shadow | Drop shadow of GhostDrawerContent. |
--ghost-elevation-4-highlight | Inner highlight shadow of GhostDrawerContent. |
--ghost-border-hairline-width | Border thickness. |
--ghost-radius-lg | Corner radius of GhostDrawerContent. |
--ghost-surface-fg | Foreground text color. |
--ghost-text-muted | Muted text color applied to GhostDrawerDescription. |
--ghost-space-inset-lg | Internal padding and viewport margin of GhostDrawerContent. |
--ghost-space-gap-md | Vertical spacing between sections inside GhostDrawerContent. |
--ghost-focus-ring-color | Outer focus-visible outline color when content receives focus. |
--ghost-focus-ring-contrast | Inner focus-visible halo color. |
--ghost-focus-ring-offset | Focus-visible outline offset. |
--ghost-focus-ring-width | Focus-visible outline width. |
--ghost-motion-enter-duration | Slide and fade entry duration when motion is allowed. |
--ghost-motion-enter-easing | Slide and fade entry easing when motion is allowed. |
--ghost-motion-fade-duration | Opacity-only entry duration under prefers-reduced-motion: reduce. |
--ghost-motion-easing-standard | Opacity-only entry easing under prefers-reduced-motion: reduce. |
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 when focused on the trigger, or closes when focused on GhostDrawerClose. | Not reviewed |
Space | Opens or toggles the drawer when focused on the trigger, or closes when focused on GhostDrawerClose. | Not reviewed |
Tab | Cycles forward within modal drawers. | Not reviewed |
Shift+Tab | Cycles backward within modal drawers. | Not reviewed |
Escape | Dismisses the topmost open drawer when closeOnEscape is true 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/themed
Elevation-4 end-side sheet with scrim overlay, slide-in entry, and themed button actions.
drawer/sides
Logical start and end side panels plus top and bottom sheets, including an RTL subtree.
drawer/non-modal
Drawer with modal=false: no overlay, scroll lock, or focus trap; the page stays interactive.
drawer/nested
Confirmation dialog stacked above a filter drawer; Escape dismisses only the topmost layer.