shadcn.io is an independent project built on shadcn/ui
The link reads Project Proposal.pdf. The card shows a file icon in the destructive color, 2.4 MB, PDF Document, a summary of the Q1 proposal, and Last modified: December 15, 2023.
Use it in a file list so people can confirm the document before opening it. If the card has to open on a tap, use a Popover. In Solid, Ark UI opens the card after a short pause.
Installation
Anatomy

Usage
<HoverCard>
<HoverCardTrigger asChild={props => <a {...props({
"class": "flex items-center gap-2 font-medium text-sm underline underline-offset-4"
})} href="#">
<FileTextIcon aria-hidden="true" class="size-4" />
Project Proposal.pdf
</a>} />
<HoverCardContent class="w-80">
<div class="flex flex-col gap-3">
<div class="flex items-start gap-3">
<div class="flex size-10 shrink-0 items-center justify-center rounded-md bg-destructive/10">
<FileTextIcon aria-hidden="true" class="size-5 text-destructive" />
</div>
<div class="flex flex-1 flex-col gap-1">
<h4 class="font-semibold text-sm">Project Proposal.pdf</h4>
<p class="text-muted-foreground text-xs">
2.4 MB · PDF Document
</p>
</div>
</div>
<p class="text-muted-foreground text-sm">
Comprehensive project proposal including timeline, budget, and
deliverables for Q1 2024.
</p>
<p class="text-muted-foreground text-xs">
Last modified: December 15, 2023
</p>
</div>
</HoverCardContent>
</HoverCard>FAQ
What is in the card?
A file icon on a bg-destructive/10 tile, the name, 2.4 MB · PDF Document, the summary and Last modified: December 15, 2023.
How is the file link made the trigger?
HoverCardTrigger renders the file link through its asChild function.
Why is the file icon red?
Red is the usual color for PDF files. The tile uses the destructive token, bg-destructive/10 with a text-destructive icon, so it follows the theme. Pick a token per file type.
How do I change how fast the card opens and closes?
The card opens a moment after the pointer rests on the trigger and stays up long enough for the pointer to move into it. Both delays are in milliseconds.
Set openDelay and closeDelay on HoverCard; they default to 10 and 100. positioning picks another side than the bottom.
Does the card open from the keyboard and on touch screens?
Focusing the link opens the card, moving focus away or pressing Escape closes it. Touch screens have no hover, so keep what matters reachable elsewhere, or use a Popover when the card has to open on a tap.
API Reference
Hover Card
Sets asChild and props. The rest is on the Hover Card page.





