Drawer
The same dialog, sliding in from any edge.
import
import { Drawer } from '@joshicodes/cock';Sides
Keyboard
- Esc
- Closes, unless `dismissible` is false
Behaviour
- Renders into `<body>` and positions itself against its trigger, so an `overflow: hidden` ancestor or a scrolling table cannot clip it.
- Takes the modal props plus `side`.
API
Read out of the component sources at build time, so it matches the version you installed.
Every component also takes class, merged
through tailwind-merge so your utility wins.
Props of Drawer
| Prop | Type | Default |
|---|---|---|
open bindable | boolean | false |
side | 'left' | 'right' | 'top' | 'bottom' | 'right' |
title | string | — |
description | string | — |
size Width for left/right, height for top/bottom. | string | — |
dismissible | boolean | true |
class | string | — |
Snippets of Drawer
| Snippet | Type | Default |
|---|---|---|
children | Snippet | — |
footer | Snippet | — |
Events of Drawer
| Event | Type | Default |
|---|---|---|
onclose | () => void | — |