{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "flip-card",
  "title": "Flip Card",
  "author": "VenusUI",
  "description": "A two-sided card that turns over in 3D, by button or on hover.",
  "dependencies": [
    "lucide-react"
  ],
  "files": [
    {
      "path": "registry/default/ui/flip-card.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { RotateCw } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface FlipCardProps {\n  /** Content on the front face. */\n  front: React.ReactNode\n  /** Content on the back face. */\n  back: React.ReactNode\n  /** Accessible label for the flip button, e.g. \"Show details\". */\n  flipLabel?: string\n  /** Also flip while a mouse hovers the card. */\n  flipOnHover?: boolean\n  className?: string\n}\n\n/**\n * A card with two faces that turns over in 3D. A button flips it, so it works\n * with keyboard and touch; the hidden face is `inert` and `aria-hidden`.\n * With reduced motion the faces swap instantly instead of rotating.\n */\nfunction FlipCard({ front, back, flipLabel = \"Flip card\", flipOnHover = false, className }: FlipCardProps) {\n  const [flipped, setFlipped] = React.useState(false)\n  const [hovered, setHovered] = React.useState(false)\n  const showBack = flipped || (flipOnHover && hovered)\n\n  const face = \"absolute inset-0 overflow-hidden rounded-xl border bg-card p-6 [backface-visibility:hidden]\"\n\n  return (\n    <div\n      data-slot=\"flip-card\"\n      className={cn(\"group relative h-64 w-full max-w-sm [perspective:1200px]\", className)}\n      onPointerEnter={(event) => event.pointerType === \"mouse\" && setHovered(true)}\n      onPointerLeave={() => setHovered(false)}\n    >\n      <div\n        className={cn(\n          \"relative size-full transition-transform duration-500 [transform-style:preserve-3d] motion-reduce:transition-none\",\n          showBack && \"[transform:rotateY(180deg)]\"\n        )}\n      >\n        <div className={face} aria-hidden={showBack} inert={showBack ? true : undefined}>\n          {front}\n        </div>\n        <div className={cn(face, \"[transform:rotateY(180deg)]\")} aria-hidden={!showBack} inert={!showBack ? true : undefined}>\n          {back}\n        </div>\n      </div>\n      <button\n        type=\"button\"\n        aria-pressed={flipped}\n        aria-label={flipLabel}\n        onClick={() => setFlipped((value) => !value)}\n        className=\"absolute top-3 right-3 z-10 inline-flex size-8 items-center justify-center rounded-md border bg-background/80 text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50\"\n      >\n        <RotateCw aria-hidden=\"true\" className=\"size-4\" />\n      </button>\n    </div>\n  )\n}\n\nexport { FlipCard, type FlipCardProps }\n",
      "type": "registry:ui"
    }
  ],
  "meta": {
    "version": "0.1.0"
  },
  "categories": [
    "cards",
    "interactive",
    "animations"
  ],
  "type": "registry:ui"
}