HoverCard
Rich preview shown on hover or focus. Unlike Tooltip, content may include interactive elements (links). Open/close delays are independent (openDelay / closeDelay, set on the Root). HoverCard is the compound Root (HoverCard.Trigger, HoverCard.Popup, HoverCard.Title, HoverCard.Content); there is no assembled preset, so the recipes below are the starting point. onOpenChange(open, details) reports details.reason of hover, focus, escape-key or imperative, and details.cancel() vetoes the change. The trigger child must forward DOM props — there is no render prop.
The popup is a native popover element positioned with CSS anchor positioning, rendered in place (no portal). It has role="dialog" named by HoverCard.Title, and the trigger gets aria-details while it is open. Reasons also include outside-press. State attributes and onOpenChange details are documented in Overlay lifecycle.
Examples
Default
Wrap a focusable trigger (often a Link) in HoverCard.Trigger and put the preview in HoverCard.Popup.
import { HoverCard, Link } from '@var-ui/react';
<HoverCard.Root>
<HoverCard.Trigger>
<Link href="/u/ada">Ada Lovelace</Link>
</HoverCard.Trigger>
<HoverCard.Popup>
<HoverCard.Title>Ada Lovelace</HoverCard.Title>
<HoverCard.Content>
<p>Mathematician and early computing pioneer.</p>
</HoverCard.Content>
</HoverCard.Popup>
</HoverCard.Root>Rich content
Add a HoverCard.Title plus denser body copy or links for profile / entity previews, with a custom openDelay and placement.
import { HoverCard, Link, Text } from '@var-ui/react';
<HoverCard.Root openDelay={400}>
<HoverCard.Trigger>
<Link href="/u/ada">@ada</Link>
</HoverCard.Trigger>
<HoverCard.Popup placement="bottom">
<HoverCard.Title>Ada Lovelace</HoverCard.Title>
<HoverCard.Content>
<Text size="sm" tone="secondary">
Mathematician and early computing pioneer.
</Text>
<Link href="/u/ada">View profile</Link>
</HoverCard.Content>
</HoverCard.Popup>
</HoverCard.Root>Props
Accessibility
Opens on hover and focus without trapping focus, so users can move into the card to activate links. Prefer generous hit targets on the trigger. For click-only panels use Popover.