Components
HoverCard
A preview revealed on hover.
HoverCard is built on the Base UI PreviewCard primitive. It displays additional content when the user hovers over a trigger.
Installation
pnpm dlx shadcn@latest add https://faber-ui.vercel.app/r/hover-card.jsonUsage
"use client";
import {
HoverCard,
HoverCardContent,
HoverCardTrigger,
} from "@/components/ui/hover-card";
export default function Example() {
return (
<HoverCard>
<HoverCardTrigger>Hover me</HoverCardTrigger>
<HoverCardContent>Additional content.</HoverCardContent>
</HoverCard>
);
}Examples
Default
API
Each part forwards every prop of what it is built on, including className and render where Base UI supports it. The props column lists only what Faber UI adds on top.
| Part | Built on | Props |
|---|---|---|
HoverCarddata-slot="hover-card" | PreviewCard.RootBase UI | — |
HoverCardTriggerdata-slot="hover-card-trigger" | PreviewCard.TriggerBase UI | — |
HoverCardContentdata-slot="hover-card-content" | PreviewCard.PopupBase UI |
|
Changelog
- v0.3.0Popover, DropdownMenu, ContextMenu, Menubar, Select, Combobox, HoverCard, Tooltip, Dialog and AlertDialog enter and exit with interruptible transitions on the kit easing tokens, and tw-animate-css is no longer a depen…minor
- v0.1.0Restore open and close animations on every menu-family popup.patch
Last updated on