Popover: Detached triggers
Create a handle with createPopoverHandle to share one popover between several triggers anywhere in the tree. Each trigger passes a payload, and the popup renders it through a function child.
This adds the example as components/examples/popover/detached.tsx, together with the Popover component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/popover-detached.jsonTo add only the component, follow the Popover installation.
Props in this example
The Popover props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
handleConnects detached triggers. | PopoverHandle<Payload> | – |
| Prop | Type | Default |
|---|---|---|
handle | PopoverHandle<Payload> | – |
payloadPassed to the popup when this trigger opens it. | Payload | – |
render | ReactElement | (props, state) => ReactElement | <button> |
Every prop is in the Popover API reference.
- Content that changes size
- Controlled
- Placement
- Open on hover
- With a calendar
- Nested
- Long content
- Modal
- Disabled
- Right to left
See them all, with keyboard support and accessibility notes, on the Popover 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.
- Dropdown menuA menu of actions and options behind a button, with groups, submenus, checkbox and radio items, and shortcuts.