A `Card` docked to one edge of the viewport as a slide-in panel, built on [Radix `Dialog`](https://www.radix-ui.com/primitives/docs/components/dialog) for focus trapping, Escape-to-close, and outside-click-to-close. It has no opinion on what goes inside the panel — an optional `title` renders a header with a close button, otherwise just the `children` are shown.

pnpm add @behivetech/atoms.drawer

You are viewing Drawer v0.4.8, snapshotted 2026-11-09. The latest is v0.4.10. Go to the latest →

Examples of v0.4.8 are shown as code; only the latest version runs live. Open the live examples →

Basic Drawer
1const BasicDrawer = () => (
2 <Drawer onClose={() => {}} title="Add Block" placement="right">
3 Panel content
4 </Drawer>
5);
6
7render(<BasicDrawer />);
Drawer Without Title
1const DrawerWithoutTitle = () => (
2 <Drawer onClose={() => {}} placement="right">
3 Panel content, no header
4 </Drawer>
5);
6
7render(<DrawerWithoutTitle />);
Non Blocking Right Panel Drawer
1const NonBlockingRightPanelDrawer = () => (
2 <Drawer onClose={() => {}} title="Block" placement="right" backdrop={false}>
3 Non-blocking side panel content
4 </Drawer>
5);
6
7render(<NonBlockingRightPanelDrawer />);
Bottom Sheet Drawer
1const BottomSheetDrawer = () => (
2 <Drawer onClose={() => {}} title="Filters" placement="bottom">
3 Slides up from the bottom edge
4 </Drawer>
5);
6
7render(<BottomSheetDrawer />);