Black Friday is here 🔥 Get Wensity Pro for 20% less with

Hover Card

A React hover card on Base UI that previews a profile or link after a short hover delay, with header, body, and footer parts and four widths.

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-[var(--muted-foreground)]">
Nina tagged{" "}
<HoverCard openDelay={300} closeDelay={150}>
<HoverCardTrigger asChild>
<button type="button" className="bg-transparent p-0 font-medium text-[var(--foreground)] underline decoration-[var(--border)] 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 text-[var(--foreground)]">Parth Sharma</p>
<p className="text-[11px] text-[var(--muted-foreground)]">@ksparth12</p>
<p className="mt-2 text-xs leading-relaxed text-[var(--muted-foreground)]">
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="#" className="text-sm font-medium text-[var(--foreground)] underline underline-offset-4 hover:text-[var(--muted-foreground)]">wensity-mono</a>
</HoverCardTrigger>
<HoverCardContent width="lg" className="p-4">
<div className="flex items-center gap-2">
<IconBrandGithub className="size-4 text-[var(--foreground)]" />
<span className="text-xs font-semibold text-[var(--foreground)]">wensity-mono</span>
</div>
<p className="mt-2 text-xs text-[var(--muted-foreground)]">
Turborepo monorepo for the Wensity Next.js marketplace and component library.
</p>
<div className="mt-4 flex items-center gap-4 text-[10px] text-[var(--muted-foreground)]">
<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="#" className="text-sm font-medium text-[var(--foreground)] underline underline-offset-4 hover:text-[var(--muted-foreground)]">fintech-template</a>
</HoverCardTrigger>
<HoverCardContent width="lg" className="p-0 overflow-hidden">
<img src="https://assets.wensity.com/templates/fintech-template/marketplace/hero.webp" alt="Preview" className="w-full object-cover aspect-[16/10]" />
<div className="p-4">
<p className="text-sm font-semibold text-[var(--foreground)]">Fintech Dashboard</p>
<p className="mt-1 text-xs text-[var(--muted-foreground)]">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, HoverCardFooter } 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="#" className="text-sm font-medium text-[var(--foreground)] underline underline-offset-4 hover:text-[var(--muted-foreground)]">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 text-[var(--foreground)]">Push Notifications</p>
<p className="text-xs text-[var(--muted-foreground)]">Receive alerts for registry changes.</p>
</div>
<Switch checked />
</div>
<HoverCardFooter className="mt-3.5 pt-3">
<Button
size="sm"
variant="white"
className="h-7 rounded-md px-2.5 text-[11px] font-medium"
>
Configure
</Button>
</HoverCardFooter>
</HoverCardContent>
</HoverCard>
);
}

Overview

Hover Card is a React and Tailwind CSS hover card built on Base UI Preview Card, in Next.js or any React app, for showing a profile, repository, or link preview when someone rests the pointer on it. It waits 600 milliseconds before opening and 300 before closing, so a quick pass does not flash a card, and both delays are props. The content avoids screen edges, comes in four widths, and has header, body, and footer parts. Touch screens have no hover, so keep the same information reachable by tapping the link.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add hover-card

Usage

Import HoverCard from @/components/wensity/hover-card and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
import {
HoverCard,
HoverCardTrigger,
HoverCardContent,
} from "@/components/wensity/hover-card";
export function HoverCardDemo() {
return (
<p className="max-w-sm text-sm leading-6 text-[var(--muted-foreground)]">
The launch note keeps{" "}
<HoverCard openDelay={220} closeDelay={140}>
<HoverCardTrigger asChild>
<button type="button" className="bg-transparent p-0 font-medium text-[var(--foreground)] underline decoration-[var(--border)] underline-offset-4">
source artifact
</button>
</HoverCardTrigger>
<HoverCardContent width="md">
<p className="text-sm font-semibold text-[var(--foreground)]">Source artifact</p>
<p className="mt-1 text-xs text-[var(--muted-foreground)]">
The generated file that every install and source view resolves before release.
</p>
</HoverCardContent>
</HoverCard>{" "}
details next to the sentence they explain.
</p>
);
}

Props

PropTypeDefaultDescription
openboolean-Controlled open state.
onOpenChange(open: boolean) => void-Called when the card opens or closes.
openDelaynumber600Milliseconds the pointer must rest before the card opens.
closeDelaynumber300Milliseconds before the card closes after the pointer leaves.
  • Fan Hover Card Stack component preview

    Fan Hover Card Stack

    Hover a stacked profile deck and watch the cards fan outward in sequence while the active one lifts to the front.

  • Follow Cursor Label component preview

    Follow Cursor Label

    A floating label that trails the cursor across your hover targets with an elastic pop-in and a soft spring settle.

  • Hover Image Gallery component preview

    Hover Image Gallery

    Hover a card in the fanned artwork row and it rises to the front, showing a colored pill with that card's title.

  • Animated 3D Folder component preview

    Animated 3D Folder

    A real CSS 3D folder that tilts toward your cursor, drops its cover open, and lifts its files into a stepped index.