Skip to content

HoverCard

import { HoverCard } from 'yarcl';
Written by @ada
<HoverCard content={<UserPreview id="ada" />}>
<Link href="/users/ada">@ada</Link>
</HoverCard>

The pointer can move from the trigger into the card without closing it, so the card can contain links. Hover cards are supplementary: don’t put anything in them that isn’t reachable elsewhere.

PropTypeDefaultDescription
children requiredReactElementA single focusable element, usually a Link.
content requiredReactNodeRich preview content. Can contain links; the pointer can move into the card without closing it.
closeDelaynumber150Delay before closing after the pointer leaves, in ms.
openDelaynumber300Delay before opening, in ms.
paddingSpacingconfigconfig.defaults.paddingInner padding, from the spacing config.
placementPlacement'bottom'Preferred side. Flips when there isn't room.
radiusRadiusconfigconfig.defaults.radiusCorner radius, from the radii config.