For sighted users to preview content available behind a link.
1import { Button } from "@ngrok/mantle/button";2import { HoverCard } from "@ngrok/mantle/hover-card";3import { Icon } from "@ngrok/mantle/icon";4import { CalendarIcon } from "@phosphor-icons/react/Calendar";5import { ShrimpIcon } from "@phosphor-icons/react/Shrimp";6 7<HoverCard.Root>8 <HoverCard.Trigger asChild>9 <Button type="button" appearance="link">10 Open Hover Card11 </Button>12 </HoverCard.Trigger>13 <HoverCard.Content className="w-80">14 <div className="flex justify-between space-x-4">15 <div className="flex size-16 shrink-0 items-center justify-center rounded-full bg-pink-300">16 <Icon svg={<ShrimpIcon />} className="size-12" />17 </div>18 <div className="space-y-1">19 <h4 className="text-sm font-medium">@ngrok/mantle</h4>20 <p className="text-sm">The Design System – created and maintained by @ngrok.</p>21 <div className="flex items-center pt-2">22 <Icon svg={<CalendarIcon />} className="mr-2 h-4 w-4 opacity-70" />{" "}23 <span className="text-muted-foreground text-xs">Joined November 2023</span>24 </div>25 </div>26 </div>27 </HoverCard.Content>28</HoverCard.Root>;The HoverCard component is built on top of Radix UI Hover Card.
The root stateful component that manages the open/closed state of the hover card.
The trigger element that opens the hover card when hovered.
The content to render inside the hover card. Appears in a portal with rich styling and animations.