Hover card
Hover card component, a card with rich and interactive content that opens on hover or focus, with delays and automatic placement.
How to use it
Run npx @blossomui/react add hover-card, or copy src/components/UI/HoverCard/HoverCard.tsx into your React project and import it.
import { HoverCard } from './components/ui/HoverCard'Props
HoverCardProps
| Prop | Type | Description |
|---|---|---|
| content (required) | ReactNode | The rich content of the card: an avatar, a bio, a button... Unlike a Tooltip it can be pointed at and used. |
| children (required) | ReactNode | The element that opens the card when it is hovered or focused. |
| placement | 'top' | 'bottom' | Preferred side. It flips to the other one when there is no room. |
| openDelay | number | Milliseconds to wait before opening. |
| closeDelay | number | Milliseconds to wait before closing, so the pointer can travel from the trigger to the card. |
| width | number | Width of the card in pixels. |
| label | string | Accessible name of the card. |
| color | string | Accent color of the card: any CSS color. Without it the component uses `--blossom-accent`. |
| className | string | Classes of the element that wraps the trigger. It is `inline-flex` by default. |