Drawer
Edge panel for filters, detail, and settings. It uses the same mask language as Modal: 40% black, mask z-index 3990, panel 4000. While open it locks body scroll and traps focus.
Demos
Right
Default
placement is right. width defaults to 400. Side panel content scrolls inside the body.
Left
placement="left". On viewports ≤640px, left and right drawers use calc(100% - 48px). A narrower navigation pane.
Top
Top keeps a modest height so content below stays hinted.
height defaults to 40vh. A short banner drawer.
Bottom
Bottom uses a large top radius, the same sheet language as the date picker on small screens.
Bottom sheet content.
With footer
Slot
footer for the same right-aligned actions as Modal. Choose what stays visible.
Form filters
Body content scrolls. Fields use the same 34px control height as Input.
No mask
show-mask="false" omits the mask and sets aria-modal="false". Escape still closes when closable. No dim layer behind this panel.
Alpine
html
<div x-data="{ open: false }">
<gk-button type="button" x-on:click="open = true">Filters</gk-button>
<gk-drawer title="Filters" x-bind:open="open" x-on:update:open="open = $event.detail">
<p>Edge panel</p>
</gk-drawer>
</div>API
Props
| Prop | Type | Default |
|---|---|---|
open | boolean | false |
title | string | '' |
placement | 'left' | 'right' | 'top' | 'bottom' | 'right' |
width | number | string | 400 |
height | number | string | 40vh |
closable | boolean | true |
mask-closable | boolean | true |
show-mask | boolean | true |
width applies to left/right. height applies to top/bottom. A bare number is pixels.
Slots
| Name | Description |
|---|---|
| default | Body |
header | Extra header content |
footer | Actions |
Events
| Name | Detail |
|---|---|
update:open | false when dismissed |
close | Dismissed |
CSS parts
mask, panel, header, title, close, body, footer.
The panel enters over 180ms with a 12px translate from its edge. It shares Modal’s blocking stack, so later dialogs and drawers sit 10 z-index steps higher.