Dropdown menu: Safe area
Moving diagonally from a submenu trigger toward its submenu crosses sibling triggers. The safe area keeps the submenu open while the pointer heads into it. Turn on showSafeArea to see it live: the dot turns green inside the area and red where the submenu would switch.
This adds the example as components/examples/dropdown-menu/safe-area.tsx, together with the Dropdown menu component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/dropdown-menu-safe-area.jsonTo add only the component, follow the Dropdown menu installation.
Props in this example
The Dropdown menu props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
showSafeAreaDraws the submenu safe area while the menu is open. For debugging and demos. | boolean | false |
| Prop | Type | Default |
|---|---|---|
render | ReactElement | (props, state) => ReactElement | <button> |
| Prop | Type | Default |
|---|---|---|
variant | "default" | "destructive" | "default" |
Every prop is in the Dropdown menu API reference.
- Checkboxes
- Radio group
- Check on the right
- Select-like
- Row actions
- Controlled
- Open on hover
- Disabled
- Long content
- Scrolling
- Inside a sheet
- Right to left
See them all, with keyboard support and accessibility notes, on the Dropdown menu page.
- 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.
- DrawerA panel that slides in from any edge and follows your finger, with snap points, a working handle and nested drawers that stack.
- Hover cardA preview card that opens when a link is hovered or focused, for content sighted users can glance at.