npx gluestack-ui add drawerimport {
Drawer,
DrawerBackdrop,
DrawerContent,
DrawerHeader,
DrawerCloseButton,
DrawerBody,
DrawerFooter,
} from '@/components/ui/drawer';


export default () => (
<Drawer>
<DrawerBackdrop />
<DrawerContent>
<DrawerHeader>
<DrawerCloseButton></DrawerCloseButton>
</DrawerHeader>
<DrawerBody />
<DrawerFooter />
</DrawerContent>
</Drawer>
);
| Prop | Type | Default | Description |
|---|---|---|---|
isOpen | boolean | - | If true, the drawer will open. Useful for controllable state behavior. |
onClose | () => any | - | Callback invoked when the drawer is closed. |
defaultIsOpen | boolean | - | Specifies the default open state of the Drawer |
initialFocusRef | React.RefObject<any> | - | The ref of element to receive focus when the drawer opens. |
finalFocusRef | React.RefObject<any> | - | The ref of element to receive focus when the drawer closes |
avoidKeyboard | boolean | - | If true, the Drawer will avoid the keyboard. |
closeOnOverlayClick | boolean | - | If true, the Drawer will close when the overlay is clicked. |
isKeyboardDismissable | boolean | - | If true, the keyboard can dismiss the Drawer |
children | any | - | The content to display inside the Drawer |
| Prop | Type | Default | Description |
|---|---|---|---|
focusable | boolean | false | If true, Drawer Content will be focusable. |
| Name | Value | Default |
|---|---|---|
size | xs | sm | md | lg | full | sm |
anchor | left | right | top | bottom | left |