Skip to content
SENVENLI UI

Hover card

A preview card that opens when the pointer rests on its trigger or the trigger gets keyboard focus.
A person behind a link
import { HoverCard } from "@senvenli/react/overlay";

Guidelines

When to use it

  • A preview of a person or a record behind a link.

Use something else when

  • A few words about a control. Tooltip
  • Content people open on purpose with a click. Popover

Do and avoid

  • Supplementary only: the trigger must make sense without the card.

Accessibility

Built in

  • Opens after a delay on hover or focus, stays while the pointer is on it, closes with Esc.

You provide

  • A trigger that is a link (or focusable) to the full page.

API reference

HoverCard

triggerRequired
ReactElement<unknown, string | JSXElementConstructor<any>>

A link (or a focusable element) whose preview the card shows: a person's name, a record reference.

childrenRequired
React.ReactNode

The preview: an avatar and a line about the person, a record's key fields. Supplementary, never essential.

openDelay
numberDefault 500

Before it opens (ms); default 500, so moving across the page does not flash cards.

closeDelay
numberDefault 200

Before it closes after the pointer leaves (ms); default 200, enough to reach the card.

placement
PlacementDefault "bottom"