4.2.0
Core

HoverCard

A hover-summoned preview of what sits behind a trigger, for the extra context worth a glance but not a click.

Hover card

Preview content, opened on hover, and its children may be interactive. A Tooltip is a label and takes none; a Popover opens on click and stays until dismissed.

Usage

import { HoverCard, HoverCardContent, HoverCardTrigger } from '@oceanic-hub/brand-system'
<HoverCard>
  <HoverCardTrigger>…</HoverCardTrigger>
  <HoverCardContent>…</HoverCardContent>
</HoverCard>

Composition

Use the following composition to build a HoverCard:

HoverCard
├── HoverCardTrigger
└── HoverCardContent

Three surfaces answer three different questions, and picking the wrong one is the mistake this component exists to prevent: Tooltip is a label for a control that has none — hover-only, never interactive, role="tooltip". HoverCard is a preview — hover-opened, and its content may itself be interactive and focusable, the way the demo's avatar card is. Popover is click-opened and stays put until dismissed, for content a reader is meant to act inside rather than glance at. A link or a button inside a Tooltip is always the wrong one of the three.

It is hover-only, and that is a real cost, not a detail. Upstream frames this component as "for sighted users to preview content behind a link" — worth repeating rather than dropping, because it names the actual limitation: nothing arrives on hover for a touch screen or a keyboard-only reader beyond focus, which HoverCard does listen for but far less discoverably than a pointer. Never put information behind a HoverCard that a reader has no other way to reach — a name behind an avatar it also labels visibly, an extra fact beside a number the row already shows, never the ONLY place a detail lives.

Both delays stay open on purpose: openDelay/closeDelay default to Radix's 700ms/300ms, and only the call site knows how dense its rows are — a table of forty avatars wants a longer openDelay than a single byline, or every pass of the pointer flickers a dozen cards.

It opens on a fade, never a pop: click-summoned surfaces use animate-oc-pop-in because the interface is answering something the reader did; a hover card arrives on intent nobody has committed to yet, so animate-oc-fade-in/animate-oc-fade-out is the whole motion. Elevation is the package's usual 1px border-hairline-strong on bg-elevated, never upstream's shadow-md.

Sides

side passes straight through to Radix, flipping automatically if the chosen side has no room — set it when a trigger sits at an edge the default bottom would collide with.

API Reference

See the HoverCard API page for every prop of every part, with types, defaults and the contract that pins them.

On this page