Skip to content

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.

All component references

Props ​

NameTypeDefaultRequiredDescription
openboolean—NoControlled open state forwarded to headless GhostDrawer.
defaultOpenbooleanfalseNoInitial open state when open is omitted.
modalbooleantrueNoEnables modal behavior (trapped focus, scroll lock, inert background, overlay).
sideGhostDrawerSide"end"NoViewport edge forwarded to headless GhostDrawer ('start', 'end', 'top', 'bottom').
dirGhostDrawerDirection—NoExplicit writing direction for mapping logical start/end sides.

Emits ​

None declared.

Models ​

PropEventTypeDescription
openupdate:openbooleanv-model:open binding for controlled state.

Slots ​

NameDescription
defaultDrawer trigger, overlay, content, title, description, and close parts.

Slot props: default ​

NameTypeDescription
openbooleanCurrent open state.
close() => voidCloses the drawer.
sideGhostDrawerSideEffective side.

Exposed members ​

None declared.

Parts and data attributes ​

AttributeValueDescription
data-parttriggerTrigger control rendered by GhostDrawerTrigger.
data-partoverlayFull-viewport backdrop rendered by GhostDrawerOverlay with data-themed.
data-partcontentEdge-anchored elevation-4 drawer surface rendered by GhostDrawerContent with data-themed; positioned from data-side and data-dir.
data-parttitleAccessible heading rendered by GhostDrawerTitle.
data-partdescriptionMuted supporting description rendered by GhostDrawerDescription.
data-partcloseClose control rendered by GhostDrawerClose.
data-stateopenApplied to trigger, overlay, and content while open.
data-stateclosedApplied to trigger while closed.
data-statesidedata-side on trigger, overlay, and content selects the anchored edge.

CSS variables ​

NameDescription
--ghost-scrimShared semantic backdrop color of GhostDrawerOverlay, supplied by the theme.
--ghost-elevation-4-bgSurface background color of GhostDrawerContent.
--ghost-elevation-4-borderBorder color of GhostDrawerContent.
--ghost-elevation-4-shadowDrop shadow of GhostDrawerContent.
--ghost-elevation-4-highlightInner highlight shadow of GhostDrawerContent.
--ghost-border-hairline-widthBorder thickness.
--ghost-radius-lgCorner radius of GhostDrawerContent.
--ghost-surface-fgForeground text color.
--ghost-text-mutedMuted text color applied to GhostDrawerDescription.
--ghost-space-inset-lgInternal padding and viewport margin of GhostDrawerContent.
--ghost-space-gap-mdVertical spacing between sections inside GhostDrawerContent.
--ghost-focus-ring-colorOuter focus-visible outline color when content receives focus.
--ghost-focus-ring-contrastInner focus-visible halo color.
--ghost-focus-ring-offsetFocus-visible outline offset.
--ghost-focus-ring-widthFocus-visible outline width.
--ghost-motion-enter-durationSlide and fade entry duration when motion is allowed.
--ghost-motion-enter-easingSlide and fade entry easing when motion is allowed.
--ghost-motion-fade-durationOpacity-only entry duration under prefers-reduced-motion: reduce.
--ghost-motion-easing-standardOpacity-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 ​

KeyActionAutomated browser test
EnterOpens or toggles the drawer when focused on the trigger, or closes when focused on GhostDrawerClose.Not reviewed
SpaceOpens or toggles the drawer when focused on the trigger, or closes when focused on GhostDrawerClose.Not reviewed
TabCycles forward within modal drawers.Not reviewed
Shift+TabCycles backward within modal drawers.Not reviewed
EscapeDismisses 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.

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

Examples ​

drawer/themed ​

Example source

Themed

Elevation-4 end-side sheet with scrim overlay, slide-in entry, and themed button actions.

Order #4182Shipped
Order #4182 shipped to Lisbon · €148.00

drawer/sides ​

Example source

Sides

Logical start and end side panels plus top and bottom sheets, including an RTL subtree.

drawer/non-modal ​

Example source

Non-modal

Drawer with modal=false: no overlay, scroll lock, or focus trap; the page stays interactive.

drawer/nested ​

Example source

Nested

Confirmation dialog stacked above a filter drawer; Escape dismisses only the topmost layer.