shadcn.io is not affiliated with official shadcn/ui
Hover Card examples · Info
Simple Info Tooltip Hover Card for React
A help icon beside a label that opens a short note about the storage limit.
A help icon beside Storage Limit opens a card with one sentence about the plan's storage and how to get more. The smallest hover card: a label, an icon and a note.
Preview
Installation
FAQ
What is in the card?
One text-sm paragraph: the plan includes 100GB of storage, upgrade for more. No title, since the label beside the icon already says what it is about.
How is the help icon made the trigger?
HoverCardTrigger takes the help icon through render, a button with its classes.
How is the icon button named?
The CircleHelpIcon is hidden from assistive tech, so the button carries aria-label="About the storage limit".
How wide is the card?
The default hover card width. Set a width class such as w-80 on the card to fit longer content.
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.
The demo sets delay 10 and closeDelay 100 on HoverCardTrigger. side and align on HoverCardContent place it.
Does the card open from the keyboard and on touch screens?
Focusing the icon button opens the card, moving focus away or pressing Escape closes it. The icon button carries an aria-label, so it is announced by name. Touch screens have no hover, so keep what matters reachable elsewhere, or use a Popover when the card has to open on a tap.
Related
- Info with Title Hover CardAn info icon beside a label that opens a
- Technical Info Hover CardA code icon beside a label that opens the
- Simple TooltipAn outline button that shows a one-line
- Warning Info Hover CardA warning banner whose Details link opens
- Info with Icon and Badge Hover CardA Verified badge that opens a card
- Document Preview Hover CardA file link that opens a preview card