# Drawer
A panel that slides in from the edge of the screen with swipe gestures, snap points, and nested drawer support.
## Installation
Start from a Svelte 5 application, then install the component package, shared theme, and Bits UI peer:
```bash
pnpm add coss-svelte @coss-svelte/theme bits-ui
```
Import `@coss-svelte/theme/style-coss.css` after Tailwind from the application's global stylesheet.
## Usage
```svelte
Open drawer
Notifications
This is the description of the drawer.
Close
```
## Anatomy
- `Drawer`
- `DrawerClose`
- `DrawerContent`
- `DrawerCreateHandle`
- `DrawerDescription`
- `DrawerFooter`
- `DrawerHeader`
- `DrawerPanel`
- `DrawerPopup`
- `DrawerTitle`
- `DrawerTrigger`
## API Reference
### Drawer
A panel that slides in from the edge of the screen with swipe gestures, snap points, and nested drawer support.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `bind:open` | `boolean` | `false` | Open state for the popup or disclosure. Bind with `bind:open`. |
| `trigger` | `string` | `"Open"` | Fallback trigger text rendered when custom children are not provided. |
| `title` | `string` | `""` | Title text rendered by the component's built-in fallback layout. |
| `description` | `string` | `""` | Supporting text rendered by the component's built-in fallback layout. |
**Composition and refs**
- `children: Snippet<[]>`
Inherits from [Bits UI Dialog.Root](https://bits-ui.com/docs/components/dialog#root).
### DrawerClose
Renders a control that closes the parent surface.
**Composition and refs**
- `children: Snippet<[]>`
- `child: Snippet<[{ props: Record }]>`
- `bind:ref: HTMLElement \| null`
Inherits from [Bits UI Dialog.Close](https://bits-ui.com/docs/components/dialog#close).
### DrawerContent
Wraps the primary content for the parent component.
**Composition and refs**
- `children: Snippet<[]>`
Inherits from [Svelte component attributes](https://svelte.dev/docs/svelte/basic-markup#Attributes).
### DrawerCreateHandle
Renders the drag or grab handle for the parent component.
**Composition and refs**
- `bind:ref: HTMLElement \| null`
Inherits from [Bits UI Dialog.Close](https://bits-ui.com/docs/components/dialog#close).
### DrawerDescription
Provides supporting copy for the parent component.
**Composition and refs**
- `children: Snippet<[]>`
- `bind:ref: HTMLElement \| null`
Inherits from [Bits UI Dialog.Description](https://bits-ui.com/docs/components/dialog#description).
### DrawerFooter
Groups footer content and actions for the parent component.
**Composition and refs**
- `children: Snippet<[]>`
Inherits from [Svelte component attributes](https://svelte.dev/docs/svelte/basic-markup#Attributes).
### DrawerHeader
Groups heading content for the parent component.
**Composition and refs**
- `children: Snippet<[]>`
Inherits from [Svelte component attributes](https://svelte.dev/docs/svelte/basic-markup#Attributes).
### DrawerPanel
Renders the main panel surface for the parent component.
**Composition and refs**
- `children: Snippet<[]>`
Inherits from [Svelte component attributes](https://svelte.dev/docs/svelte/basic-markup#Attributes).
### DrawerPopup
Renders the floating or modal surface for the parent component.
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `portalProps` | `{ disabled?: boolean; to?: PortalTarget }` | `{}` | Configures the exact Bits Portal target (`to`) or renders inline when `disabled`. |
**Composition and refs**
- `children: Snippet<[]>`
- `bind:ref: HTMLElement \| null`
Inherits from [Bits UI Dialog.Content](https://bits-ui.com/docs/components/dialog#content).
### DrawerTitle
Names the parent surface or section.
**Composition and refs**
- `children: Snippet<[]>`
- `bind:ref: HTMLElement \| null`
Inherits from [Bits UI Dialog.Title](https://bits-ui.com/docs/components/dialog#title).
### DrawerTrigger
Renders the control that opens, closes, or selects related content.
**Composition and refs**
- `children: Snippet<[]>`
- `child: Snippet<[{ props: Record }]>`
- `bind:ref: HTMLElement \| null`
Inherits from [Bits UI Dialog.Trigger](https://bits-ui.com/docs/components/dialog#trigger).
## Implementation Details
| Field | Value |
| --- | --- |
| Status | Experimental |
| Foundation | custom |
| Category | Overlays & Popups |
| Particles | 14 |
## Status
Experimental in 0.1.0: dialog-style opening, closing, focus, and edge placement are available; swipe gestures, snap points, nested drawers, and responsive dialog switching are not yet supported.
## Agent Notes
- Import Svelte exports directly from `coss-svelte`.
- This is Svelte 5 code: use `class`, lowercase event properties, runes, snippets, and documented `bind:*` contracts. Do not emit JSX, React hooks, `className`, `asChild`, or Base UI imports.
- Prefer this route's example and generated API table over React COSS snippets; COSS React particles are design references only.
- The copy-and-own registry is a preview. Inspect `/r/drawer.json` for the complete local file and dependency closure.
- Treat Drawer as experimental and preserve the limitations described in Status.