Drawer title

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.