miladjoodi

Hover Card

Cards

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>
  );
}

Dependencies

More by miladjoodi

View all
  • Image Diff Slider

    Image Diff Slider

    32
  • Empty State

    Empty State

  • Signature Pad

    Signature Pad

  • File Upload

    File Upload

  • Card

    Card

  • Drag Scroll

    Drag Scroll

  • Native Select

    Native Select

  • Context Menu

    Context Menu

More in Cards

View all
  • Course Design Cards

    Course Design Cards

    1.3K
  • Statistics Card 7

    Statistics Card 7

    327
  • Statistics Card 2

    Statistics Card 2

    305
  • Interactive Tech Stack Bento Grid with Hover Effects

    Interactive Tech Stack Bento Grid with Hover Effects

    625
  • Card Studio

    Card Studio

    5
  • The Item one

    The Item one

    4
  • Weather Card

    Weather Card

    65
  • Card

    Card

    9