ValyroUI Русская версия

Hover Card

Card on hover. Free, MIT · Overlays and notifications › Popovers and tours

Rich preview for sighted pointer users; the trigger must remain useful on its own.

Installation

npx valyro-cli@latest add hover-card
npx shadcn@latest add https://valyro.xyz/r/hover-card.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { HoverCard } from 'valyro-ui';

Props

PropTypeDefault
triggerReactElementA single focusable element, typically a link. Or HoverCard.Trigger.
children *ReactNodeCard content, e.g. a profile preview; stays open while the pointer is over it. In the compound form, a HoverCard.Trigger and a HoverCard.Content instead of trigger and the content.
openbooleanControlled open; use with onOpenChange.
defaultOpenbooleanfalseInitial open when uncontrolled.
onOpenChange(open: boolean) => voidCalled with the new open when it changes.
openDelaynumber500Delay before opening on hover/focus, ms.
closeDelaynumber200Delay before closing once the pointer leaves the trigger and the card, ms.
placementPlacement'bottom'
offsetnumber
matchAnchorWidthboolean
closeOnOutsideboolean
closeOnEscapeboolean
insideRefsRefObject<Element | null>[]Extra elements treated as "inside" for outside-press detection. The anchor is included automatically.
surfacebooleanApply the shared .ui-floating material (default true).
animation'pop' | 'fade' | 'spring' | 'none'Enter/exit: pop (the theme's), fade, spring (springs out of the anchor's side) or none.

Compound parts

HoverCard.Trigger (HoverCardTrigger), HoverCard.Content (HoverCardContent)

Related components

Previous: Popover · Next: Tour · All Overlays and notifications