Dropdown menu: Open on hover
openOnHover on the trigger opens the menu after delay and closes it after closeDelay. Clicking and the keyboard still work, so touch and keyboard users aren’t locked out.
This adds the example as components/examples/dropdown-menu/hover.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-hover.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 |
|---|---|---|
openOnHover | boolean | false |
delayMilliseconds before a hover opens the menu. | number | 100 |
closeDelayMilliseconds before a hover-opened menu closes. | number | 0 |
render | ReactElement | (props, state) => ReactElement | <button> |
Every prop is in the Dropdown menu API reference.
- Safe area
- Checkboxes
- Radio group
- Check on the right
- Select-like
- Row actions
- Controlled
- 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.