Drawer
Drawer component that slides from the left or the right, with sizes, focus restoration and scroll lock.
How to use it
Run npx @blossomui/react add drawer, or copy src/components/UI/Drawer/Drawer.tsx into your React project and import it.
import { Drawer } from './components/ui/Drawer'Props
DrawerProps
| Prop | Type | Description |
|---|---|---|
| closeLabel | string | Accessible name of the close button. |
| open (required) | boolean | |
| onClose (required) | () => void | |
| title (required) | string | |
| children (required) | ReactNode | |
| footer | ReactNode | Buttons shown at the bottom, for example Cancel and Save. |
| side | 'left' | 'right' | |
| size | 'sm' | 'md' | 'lg' | |
| closeOnBackdrop | boolean | Close when the user clicks outside the drawer. |