---
## Drawer
Slide-in panel overlay from any edge of the viewport.
Uses native dialog with focus trap, backdrop click dismiss, and Escape key support.
**Import:** `import { Drawer } from '@urbicon-ui/blocks';`
### Examples
```svelte
Drawer content here
```
```svelte
```
### Variants
- intent: danger, neutral, primary, secondary, success, warning (default: neutral)
- size: full, lg, md, sm, xl (default: md)
- accentEdge: false, true (default: false)
- placement: bottom, left, right, top (default: right)
### Api
| Prop | Type | Required | Default | Description |
| --- | --- | :---: | --- | --- |
| children | `Snippet` | yes | | Content rendered inside the drawer body. |
| ...HTMLDialogAttributes | `HTMLAttributes` | no | | HTML attributes (excluding: 'children' | 'open') |
| accentEdge | `DrawerVariants['accentEdge']` | no | false | Tint the panel's docked (viewport-facing) edge with a 2px accent border in the `intent` colour — `border-right` for `left`, `border-left` for `right`, `border-bottom` for `top`, `border-top` for `bottom`. Off by default, keeping symmetry with Dialog; opt in for a coloured seam that ties the drawer to a semantic purpose (e.g. a `danger` confirm drawer). |
| class | `string` | no | | Additional CSS classes applied to the drawer panel. In the same Tailwind bucket `class` wins over the `slotClasses` entry for the element it lands on. Presets and provider defaults sit below both. |
| closeOnBackdropClick | `boolean` | no | true | Whether clicking the backdrop closes the drawer. |
| closeOnEscape | `boolean` | no | true | Whether pressing Escape closes the drawer. Escape is dismissed one layer at a time: a control INSIDE the drawer that handles Escape itself — an open `Select`/`Combobox`/`Menu` panel, an open `Popover` wherever focus sits, a `clearable` `Input` with text in it — consumes the key, and the drawer stays up. The second Escape closes the drawer. This is about controls in the content; it does not apply to a consumer `onkeydown` on the Drawer itself, which cannot veto the dismiss (see utils/compose-handlers.ts) — use this prop for that. |
| footer | `Snippet` | no | | Action buttons rendered in the drawer footer. |
| hideCloseButton | `boolean` | no | false | Hides the built-in close button in the header. |
| intent | `DrawerVariants['intent']` | no | 'neutral' | Semantic purpose marker (mirrors Dialog). By default the Drawer paints no accent border — the value is exposed on the panel as `data-intent="…"` so consumers can hook presets, CSS overrides, or icon/title color via their own snippets. Set `accentEdge` to also tint the docked edge in this colour. |
| onClose | `() => void` | no | | Fires when a close of the drawer is requested — Escape, a backdrop click, the close button, `overlayStack.closeAll()` or `closeTop()` — before the exit animation, while focus is still inside. `open` is already `false` when it runs, and writing `open = true` back synchronously inside it vetoes the close: the drawer stays open, plays no exit, keeps focus and never reaches `onClosed`. A close the browser performs itself also arrives here, after the `