Drawer
Slide-in panel from any edge
Accessibility
- Ensure the trigger, popup role, and focus return behavior all describe the same interaction model.
- Provide an obvious keyboard dismissal path and avoid putting essential actions in hover-only content.
- Keep the opening control labeled, ensure focus moves predictably on open and close, and expose the popup type truthfully.
Styled quick start
Copy this entrypoint first. It includes the imports required to get the component on screen.
svelte
<script lang="ts">
import '@dryui/ui/themes/default.css';
import '@dryui/ui/themes/dark.css';
import { Drawer, Button } 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
ts
import { Drawer } from '@dryui/ui' Per-component subpath
ts
import { Drawer } from '@dryui/ui/drawer' API
Props, CSS variables, and the public data attributes you can target when styling.
| Prop | Type | Description | Default | Required | Bindable |
|---|---|---|---|---|---|
Drawer.Root | |||||
| open | boolean | Whether the overlay or disclosure is currently open. | false | — | — |
| side | toprightbottomleft | Preferred side for overlay placement. | 'right' | — | — |
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
Drawer.Trigger | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
Drawer.Content | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
Drawer.Overlay | |||||
Drawer.Header | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
Drawer.Body | |||||
| padding | boolean | — | true | — | — |
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
Drawer.Footer | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
Drawer.Close | |||||
| children | Snippet | Content rendered inside the component. | — | ✓ | — |