Hover Card

Hover preview cards for profiles, dashboards, and rich links.

Loading preview...

Examples

Practical examples and common states for the same installable component.

Profile

Inline profile mention with a rich bio card and quick follow action.

Requires: avatarbutton

examples/hover-card-profile.tsx
import { HoverCard, HoverCardTrigger, HoverCardContent } from "@/components/wensity/hover-card";
import { Avatar, AvatarImage, AvatarFallback } from "@/components/wensity/avatar";
import { Button } from "@/components/wensity/button";
export function ProfileHoverCard() {
return (
<p className="max-w-sm text-sm leading-6 text-zinc-600">
Nina tagged{" "}
<HoverCard openDelay={300} closeDelay={150}>
<HoverCardTrigger asChild>
<button type="button" className="bg-transparent p-0 font-medium text-zinc-900 underline underline-offset-4">
@ksparth12
</button>
</HoverCardTrigger>
<HoverCardContent width="lg" className="p-4">
<div className="flex items-start justify-between gap-4">
<Avatar size="md">
<AvatarImage src="https://assets.wensity.com/avatars/1.webp" alt="Parth Sharma" />
<AvatarFallback>PS</AvatarFallback>
</Avatar>
<Button size="sm" variant="secondary">Follow</Button>
</div>
<div className="mt-3">
<p className="text-sm font-semibold">Parth Sharma</p>
<p className="text-[11px] text-zinc-500">@ksparth12</p>
<p className="mt-2 text-xs leading-relaxed text-zinc-600">
Full-Stack Developer, Freelancer, & Founder. Obsessed with crafting web experiences that feel alive.
</p>
</div>
</HoverCardContent>
</HoverCard>{" "}
for the final polish pass.
</p>
);
}

Rich Preview

Detailed dashboard with icons, star counts, and tags.

examples/hover-card-rich.tsx
import { HoverCard, HoverCardTrigger, HoverCardContent } from "@/components/wensity/hover-card";
import { IconBrandGithub, IconStar, IconGitFork } from "@tabler/icons-react";
export function RichHoverCard() {
return (
<HoverCard openDelay={300} closeDelay={150}>
<HoverCardTrigger asChild>
<a href="#">wensity-mono</a>
</HoverCardTrigger>
<HoverCardContent width="lg" className="p-4">
<div className="flex items-center gap-2">
<IconBrandGithub className="size-4" />
<span className="text-xs font-semibold">wensity-mono</span>
</div>
<p className="mt-2 text-xs text-zinc-500">
Turborepo monorepo for the Wensity Next.js marketplace and component library.
</p>
<div className="mt-4 flex items-center gap-4 text-[10px] text-zinc-400">
<span className="flex items-center gap-1"><IconStar className="size-3" /> 1,289</span>
<span className="flex items-center gap-1"><IconGitFork className="size-3" /> 142</span>
</div>
</HoverCardContent>
</HoverCard>
);
}

Media

Visual overlay showing images and media elements.

examples/hover-card-media.tsx
import { HoverCard, HoverCardTrigger, HoverCardContent } from "@/components/wensity/hover-card";
export function MediaHoverCard() {
return (
<HoverCard openDelay={300} closeDelay={150}>
<HoverCardTrigger asChild>
<a href="#">fintech-template</a>
</HoverCardTrigger>
<HoverCardContent width="lg" className="p-0 overflow-hidden">
<img src="https://assets.wensity.com/templates/docs-site/marketplace/hero.webp" alt="Preview" className="w-full object-cover aspect-[16/10]" />
<div className="p-4">
<p className="text-sm font-semibold">Fintech Dashboard</p>
<p className="mt-1 text-xs text-zinc-500">Clean financial application layout with charts.</p>
</div>
</HoverCardContent>
</HoverCard>
);
}

Interactive

Interactive content elements such as buttons and switches inside the card.

Requires: switchbutton

examples/hover-card-interactive.tsx
import { HoverCard, HoverCardTrigger, HoverCardContent } from "@/components/wensity/hover-card";
import { Switch } from "@/components/wensity/switch";
import { Button } from "@/components/wensity/button";
export function InteractiveHoverCard() {
return (
<HoverCard openDelay={300} closeDelay={150}>
<HoverCardTrigger asChild>
<a href="#">Notifications</a>
</HoverCardTrigger>
<HoverCardContent width="md" className="p-4">
<div className="flex items-start justify-between gap-4">
<div>
<p className="text-sm font-semibold">Push Notifications</p>
<p className="text-xs text-zinc-500">Receive alerts for registry changes.</p>
</div>
<Switch checked />
</div>
</HoverCardContent>
</HoverCard>
);
}