Ballmac UI home

Hover Card

A compact preview of a linked resource that appears on hover or keyboard focus without hiding essential information.

Pinned project

Atlas launch

Hover or focus for a quick preview

Installation

$ pnpm dlx shadcn@latest add @ballmac/hover-card

Usage

import { HoverCard, HoverCardTrigger, HoverCardContent } from "@/components/ballmac/hover-card"

The full example is in the Code tab above.

Examples

People preview

Reviewed by Morgan Lee before publication.

API reference

PropTypeDefault
sideOffset

Space in pixels between the trigger and preview.

number8

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
TabFocuses the linked trigger and opens its preview
EscapeDismisses the preview

Use with AI

Adds optional context to a link for pointer and keyboard users; the link remains useful without the preview. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Hover Card (@ballmac/hover-card) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Preview a project or profile without navigating
  • Show supplementary link metadata

Not for

  • Interactive actions inside a panel; use popover
  • Information required to complete a task

Registry JSON: https://ui.ballmac.com/r/hover-card.json

Credits

Free to use in personal and commercial projects.

Registry
shadcn/utils