Hover detail card

HoverDetailCard is a cream-toned product card that shows a 5-column grid of square thumbnails with a title, subtitle, and status pills. Hovering the thumbnail area shrinks the tiles and reveals two action buttons over a blurred overlay.

Hover detail card
LIVE · running in a sandboxed iframe
Installed with plain shadcn add · no workarounds · theme neutral (none shipped)
See how it was built

Installation

pnpm dlx shadcn@latest add @bjork-ui/hover-detail-card

Requires @bjork-ui in the registries of your components.json (shadcn adds official directory namespaces automatically).

Usage

usage.tsx
import { HoverDetailCard } from "@/components/bjork-ui/cards/hover-detail-card" export default function Page() { return <HoverDetailCard title="Studio shots" subtitle="52 tiles" /> }
  • Showing a collection, album, or gallery preview with a row of thumbnails and a call to action on hover
  • Product or project cards that need a quick status badge and two actions such as view and edit
  • Dashboard tiles where a hover reveal keeps the default state compact

Examples

Default card

Renders the card with its built-in title, subtitle, default Unsplash thumbnails, and default buttons and pills.

default-card.tsx
import { HoverDetailCard } from "@/components/bjork-ui/cards/hover-detail-card"export default function DefaultExample() {  return <HoverDetailCard />}

Custom collection with own images

Passes custom titles, subtitle, image URLs (only the first 10 are shown), and button labels.

custom-collection-with-own-images.tsx
import { HoverDetailCard } from "@/components/bjork-ui/cards/hover-detail-card"const photos = [  "https://images.unsplash.com/photo-1493225457124-a3eb161ffa5f?w=200&h=200&fit=crop",  "https://images.unsplash.com/photo-1524863479829-916d8e77f114?w=200&h=200&fit=crop",  "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=200&h=200&fit=crop",  "https://images.unsplash.com/photo-1475721027785-f74eccf877e2?w=200&h=200&fit=crop",  "https://images.unsplash.com/photo-1517841905240-472988babdf9?w=200&h=200&fit=crop"]export default function CollectionExample() {  return (    <HoverDetailCard      title="Summer lookbook"      subtitle="5 photos"      images={photos}      primaryButton={{ text: "Open album" }}      secondaryButton={{ text: "Manage" }}    />  )}

Draft status without sparkle and without animation

Uses a custom left and right pill, hides the sparkle pill, and disables framer-motion entrance and hover animations.

draft-status-without-sparkle-and-without-animation.tsx
import { HoverDetailCard } from "@/components/bjork-ui/cards/hover-detail-card"export default function DraftExample() {  return (    <HoverDetailCard      title="Q3 product shots"      subtitle="18 tiles"      enableAnimations={false}      pills={{        left: { text: "4×4" },        sparkle: { show: false },        right: { text: "Draft", color: "bg-[#8a7a60]/14", textColor: "text-[#b8aa91]" }      }}    />  )}

API reference

PropTypeDefaultDescription
titlestring"Studio shots"Heading shown below the pills. Also used as the alt text prefix for thumbnails ("{title} {n}").
subtitlestring"52 tiles"Muted text rendered under the title.
imagesstring[]Ten Unsplash URLs (defaultImages)Thumbnail image sources. Only the first 10 are rendered, in a 5-column grid.
primaryButton{ text: string; color?: string; hoverColor?: string; textColor?: string }{ text: "Go to collection", color: "bg-[#ec5c13]", hoverColor: "hover:bg-[#f06d27]", textColor: "text-[#080808]" }Primary action shown in the hover overlay. Only text is rendered; it uses the BjorkButton accent variant. color, hoverColor, and textColor are declared in the type but not applied.
secondaryButton{ text: string; color?: string; hoverColor?: string; textColor?: string }{ text: "Edit rules", color: "bg-[#eee9df] dark:bg-[#090909]", hoverColor: "hover:bg-[#e7e1d5] dark:hover:bg-[#141414]", textColor: "text-[#171717] dark:text-[#ededed]" }Secondary action shown in the hover overlay. Only text is rendered; it uses the BjorkButton outline variant. color, hoverColor, and textColor are declared in the type but not applied.
pills{ left: { text: string; color?: string; textColor?: string }; sparkle?: { show: boolean; color?: string }; right: { text: string; color?: string; textColor?: string } }{ left: { text: "1×1", color: "bg-[#ec5c13]/12", textColor: "text-[#bd4514] dark:text-[#d86a2c]" }, sparkle: { show: true, color: "bg-[#ec5c13]/12 text-[#bd4514] dark:bg-[#090909] dark:text-[#d86a2c]" }, right: { text: "Published", color: "bg-[#2d8f62]/12 dark:bg-[#8a7a60]/14", textColor: "text-[#1f6f4b] dark:text-[#b8aa91]" } }Status pills in the bottom section. left and right are rendered with the given Tailwind color classes. sparkle controls the icon pill between them; it is hidden when show is false. Provide the whole object when overriding, because left and right are required.
enableAnimationsbooleantrueTurns framer-motion entrance and hover animations on or off. Animations are also disabled automatically when the user prefers reduced motion.

Accessibility

  • Thumbnails use alt text generated from the title and index, such as "Studio shots 1". Pass a descriptive title so the alt text is meaningful.
  • The title is rendered as an h3 and the subtitle as a p, so the card has a clear heading structure.
  • The sparkle icon is decorative and marked aria-hidden="true".
  • The action buttons only appear while the thumbnail area is hovered. They are not revealed by keyboard focus, so keyboard and touch users may not reach them. Provide an alternative route to these actions.
  • Entrance and hover motion respects prefers-reduced-motion through useReducedMotion, and enableAnimations can turn it off explicitly.
  • The action buttons are BjorkButton elements with focus-visible rings and trigger haptic feedback on pointer down by default. The card does not expose a prop to change this.

Docs written by anthropic:claude-haiku-5-5 from the registry source.

Use with Coding Agent

Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.

prompt.md
Use the "Hover detail card" component (bjork-ui/hover-detail-card) from its shadcn registry.1. Install it with: npx shadcn@latest add @bjork-ui/hover-detail-card2. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: title, subtitle, images, primaryButton, secondaryButton, pills, enableAnimations.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { HoverDetailCard } from "@/components/bjork-ui/cards/hover-detail-card" export default function Page() { return <HoverDetailCard title="Studio shots" subtitle="52 tiles" /> }```

Files & dependencies

  • components/bjork-ui/cards/hover-detail-card.tsx→ @components/bjork-ui/cards/hover-detail-card.tsx
  • lib/utils.ts→ @lib/utils.ts
  • components/bjork-ui/primitives/button.tsx→ @components/bjork-ui/primitives/button.tsx
dependenciesclass-variance-authorityclsxframer-motionlucide-reacttailwind-mergeweb-haptics

Looks similar, elsewhere