Put the link in HoverCardTrigger and the preview in HoverCardContent.
mention-preview.tsx
HoverCard
| Prop | Type | Default | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From Base UIPreviewCard.RootBase UI docs | |||||||||||||||||||||||||||||||||
| default | boolean | false | Whether the preview card is initially open. To render a controlled preview card, use the open prop instead. | ||||||||||||||||||||||||||||||
| open | boolean | — | Whether the preview card is currently open. | ||||||||||||||||||||||||||||||
| on | — | Event handler called when the preview card is opened or closed. | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||
HoverCardTrigger
<a>| Prop | Type | Default | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||
From Base UIPreviewCard.TriggerBase UI docs | |||||||||||||||||||||
| handle | PreviewCardHandle<unknown> | — | A handle to associate the trigger with a preview card. | ||||||||||||||||||
| payload | unknown | — | A payload to pass to the preview card when it is opened. | ||||||||||||||||||
| delay | number | 600 | How long to wait before the preview card opens. Specified in milliseconds. | ||||||||||||||||||
| |||||||||||||||||||||
| ...props | <a> attributes | — | Every other attribute goes to the <a>, with a ref. | ||||||||||||||||||
HoverCardContent
<div>| Prop | Type | Default | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrow | boolean | false | Show an arrow that points at the link. The gap grows from 4px to 8px. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backdrop | boolean | false | Put a clear layer under the card (Base UI PreviewCard.Backdrop). Hover on the page stops. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| portal | — | Other Base UI props of the inner parts. A className here adds to the component classes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| positioner | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backdrop | PopupPartProps<PreviewCardBackdropProps> | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrow | PopupPartProps<PreviewCardArrowProps> | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From Base UIPreviewCard.PortalBase UI docs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| anchor | — | An element to position the popup against. By default, the popup will be positioned against the trigger. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| position | "absolute""fixed" | 'absolute' | Determines which CSS position property to use. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| side | "bottom""inline-end""inline-start""left""right""top" | 'bottom' | Which side of the anchor element to align the popup against. May automatically change to avoid collisions. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HoverCardViewport
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
From Base UIPreviewCard.ViewportBase UI docs | |||
| children | ReactNode | — | The content to render inside the transition container. |
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
| Tab | Focus on the link opens the card after the delay. Focus never moves into the card. |
|---|
- TooltipPick Tooltip for a short text label of a control, such as the name of an icon button.
- PopoverPick Popover for content that people open with a click and act in, such as a form or filters.
- AvatarShows a person or a workspace as a photo, initials, or an icon. Initials show while the photo loads, and a small badge can show if the person is online.



