About
A card that reveals preview content when a user hovers over a trigger link or button, with RTL-aware positioning (left/right/top/bottom/inline-start/inline-end).
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Hover Card to your project and fits it to your theme.
Code
How Hover Card is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import {
HoverCard,
HoverCardContent,
HoverCardTrigger,
} from "@/components/ui/hover-card";
import { Button } from "@/components/ui/button";
const HOVER_CARD_SIDES = [
"inline-start",
"left",
"top",
"bottom",
"right",
"inline-end",
] as const;
export default function HoverCardDemo() {
return (
<div className="flex flex-wrap items-center justify-center gap-2 p-10">
{HOVER_CARD_SIDES.map((side) => (
<HoverCard key={side}>
<HoverCardTrigger
delay={100}
closeDelay={100}
render={<Button variant="outline" className="capitalize" />}
>
{side.replace("-", " ")}
</HoverCardTrigger>
<HoverCardContent side={side}>
<div className="flex flex-col gap-1.5">
<h4 className="font-medium">Hover Card</h4>
<p>
This hover card appears on the {side.replace("-", " ")} side of
the trigger.
</p>
</div>
</HoverCardContent>
</HoverCard>
))}
</div>
);
}
















