Drawer: Non-modal
With modal={false} there is no backdrop, the page keeps scrolling and focus can leave the drawer.
This adds the example as components/examples/drawer/non-modal.tsx, together with the Drawer component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/drawer-non-modal.jsonTo add only the component, follow the Drawer installation.
Props in this example
The Drawer props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
swipeDirectionThe edge it opens from and the direction that dismisses it. | "up" | "down" | "left" | "right" | "down" |
modalThe backdrop only renders when true. | boolean | "trap-focus" | true |
| Prop | Type | Default |
|---|---|---|
render | ReactElement | (props, state) => ReactElement | <button> |
| Prop | Type | Default |
|---|---|---|
render | ReactElement | (props, state) => ReactElement | <button> |
Every prop is in the Drawer API reference.
- Directions
- Snap points
- Scrollable content
- Forms and the keyboard
- Nested
- Confirm from a drawer
- Responsive
- Controlled
- Detached triggers
- Right to left
See them all, with keyboard support and accessibility notes, on the Drawer page.
- SheetA panel that slides in from any edge, with swipe-to-dismiss, scroll lock and stacked nesting.
- Alert dialogA confirmation dialog for destructive or important actions that waits for async work, and becomes a bottom sheet on phones.
- CommandA searchable list of actions, inline or as a ⌘K palette, with pages, shortcuts and highlighted matches.
- Context menuA menu of actions on right click or long press, with submenus, checkbox and radio items, and hold feedback on touch.
- DialogA window over the page for forms and focused tasks, with a pinned header and footer, nesting, and a swipeable bottom sheet on phones.
- Dropdown menuA menu of actions and options behind a button, with groups, submenus, checkbox and radio items, and shortcuts.