Drawer
Slide-in panel from any edge
Start Here
Start from the smallest working snippet, then move to interactive examples and the full API contract below.
Styled quick start
Copy this entrypoint first. It includes the imports required to get the component on screen.
<script lang="ts">
import '@dryui/ui/themes/default.css';
import '@dryui/ui/themes/dark.css';
import { Drawer } from '@dryui/ui';
</script>
<Drawer.Root bind:open={drawerOpen}>
<Drawer.Trigger>
<Button>Open Drawer</Button>
</Drawer.Trigger>
<Drawer.Content side="right">
<Drawer.Header>Settings</Drawer.Header>
<p>Drawer body content.</p>
</Drawer.Content>
</Drawer.Root>Import options
Root package
import { Drawer } from '@dryui/ui'Per-component subpath
import { Drawer } from '@dryui/ui/drawer'Customize
Use the interactive examples to see common variants, states, and composition patterns before building your own.
Left Drawer
<Drawer.Root side="left">
<Drawer.Trigger>
<Button variant="outline">Open Left Drawer</Button>
</Drawer.Trigger>
<Drawer.Overlay />
<Drawer.Content>
<Drawer.Header>Navigation</Drawer.Header>
<Drawer.Body>
<p>Sidebar navigation content goes here.</p>
</Drawer.Body>
<Drawer.Footer>
<Drawer.Close>Close</Drawer.Close>
</Drawer.Footer>
</Drawer.Content>
</Drawer.Root>Right Drawer
<Drawer.Root side="right">
<Drawer.Trigger>
<Button variant="outline">Open Right Drawer</Button>
</Drawer.Trigger>
<Drawer.Overlay />
<Drawer.Content>
<Drawer.Header>Settings</Drawer.Header>
<Drawer.Body>
<p>Settings panel content goes here.</p>
</Drawer.Body>
<Drawer.Footer>
<Drawer.Close>Close</Drawer.Close>
</Drawer.Footer>
</Drawer.Content>
</Drawer.Root>Structure
Compound components always start with Drawer.Root. Use this structure block to understand required wrappers before you wire state or styling.
Drawer.Root
Drawer.Trigger
Drawer.Content
Drawer.Header Compose
The full API contract lives here: props, CSS variables, and the public data attributes you can target when styling.
Compound component. Start with Drawer.Root, then add only the parts you need.
Drawer.Root
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
open | boolean | false | — | — |
side | toprightbottomleft | 'right' | — | — |
children | Snippet | — | ✓ | — |
Also accepts standard HTML attributes (class, style, id, etc.)
Drawer.Trigger
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.
Drawer.Content
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards native HTML attributes via rest props.
Drawer.Overlay
| Prop | Type | Default | Required | Bindable |
|---|
Forwards <div> attributes via rest props. Common examples: id, style, role.
Drawer.Header
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.
Drawer.Body
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.
Drawer.Footer
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.
Drawer.Close
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <button> attributes via rest props. Common examples: type, disabled, name.