docs/components/navigation/Drawer

Drawer

Slide-in drawer panel.

import { Drawer } from '@ybouhjira/hyperkit';

#Playground

Edit the code — the preview recompiles and re-renders as you type.

Live playground
Loading preview…

#Props

PropTypeDefaultDescription
open *booleanWhether the drawer is open.
onOpenChange *(open: boolean) => voidCallback fired when drawer open state changes.
sideDrawerSide'left'Which edge the drawer slides in from.
sizestringDrawer size along its slide axis. CSS length (e.g. '280px', '60%'). Defaults to min(320px, 80vw) on left/right, min(60vh, 480px) on top/bottom.
dismissiblebooleantrueWhether clicking the backdrop or pressing Escape closes the drawer.
modalbooleantrueWhether to render a dimmed, interaction-blocking backdrop behind the drawer.
trapFocusbooleanTrap keyboard focus inside the drawer while open. Defaults to modal.
children *JSX.ElementDrawer body content.
'aria-label'stringAccessible label for the drawer region.
classstringAdditional CSS class for the drawer content surface.
styleJSX.CSSPropertiesInline styles applied to the drawer content surface.

* required prop.