Hover card: Shared card
One card serves many links. Create a handle with createHoverCardHandle, give each trigger a payload, and read it in the card. Moving between names glides the card to the new link instead of closing and reopening it. The old content slides out the way you moved, the new content slides in, and the height eases between the two.
This adds the example as components/examples/hover-card/detached.tsx, together with the Hover card component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/hover-card-detached.jsonTo add only the component, follow the Hover card installation.
Props in this example
The Hover card props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
handleConnects triggers rendered outside the root. | HoverCardHandle<Payload> | – |
| Prop | Type | Default |
|---|---|---|
href | string | – |
delayMilliseconds before hover or focus opens the card. | number | 600 |
handle | HoverCardHandle<Payload> | – |
payloadPassed to the card when this trigger opens it. | Payload | – |
renderRender your own link, such as <Button variant="link" /> or a router link. | ReactElement | (props, state) => ReactElement | <a> |
| Prop | Type | Default |
|---|---|---|
side | "top" | "bottom" | "left" | "right" | "inline-start" | "inline-end" | "bottom" |
align | "start" | "center" | "end" | "center" |
Every prop is in the Hover card API reference.
See them all, with keyboard support and accessibility notes, on the Hover card page.
- MotionThe easing curves, durations and reduced-motion check every component animates with, plus hooks for size morphs and sliding highlights.
- 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.