{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "selectable-card",
  "title": "Selectable card",
  "description": "card as a radio/checkbox choice",
  "dependencies": [
    "cn@^0.4.0",
    "lucide-react@^1.52.0"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "components/kit/selectable-card.tsx",
      "content": "'use client';\nimport { cn } from 'cn';\nimport { CheckIcon, type LucideIcon } from 'lucide-react';\n\ntype Props = {\n  title: string;\n  description?: string;\n  icon?: LucideIcon;\n  /** Right-aligned detail, e.g. a price. */\n  detail?: string;\n  selected: boolean;\n  onClick: () => void;\n  /** `radio` shows a ring, `checkbox` a square. */\n  mode?: 'radio' | 'checkbox';\n  disabled?: boolean;\n  className?: string;\n};\n\n/** A whole card as a choice: plans, delivery options, payment methods. Selection is shape and colour. */\nexport function SelectableCard({ title, description, icon: Icon, detail, selected, onClick, mode = 'radio', disabled, className }: Props) {\n  return (\n    <button\n      type=\"button\"\n      role={mode}\n      aria-checked={selected}\n      disabled={disabled}\n      onClick={onClick}\n      className={cn(\n        'focus-visible:ring-ring/50 flex min-h-14 w-full items-center gap-3 rounded-lg border p-4 text-left shadow-sm transition-colors outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50',\n        selected ? 'border-primary bg-primary/5' : 'border-border bg-card hover:bg-accent',\n        className\n      )}>\n      {Icon ? <Icon className={cn('size-5 shrink-0', selected ? 'text-primary' : 'text-muted-foreground')} aria-hidden /> : null}\n      <span className=\"min-w-0 flex-1\">\n        <span className=\"block font-medium\">{title}</span>\n        {description ? <span className=\"text-muted-foreground block text-sm\">{description}</span> : null}\n      </span>\n      {detail ? <span className=\"font-semibold\">{detail}</span> : null}\n      <span\n        aria-hidden\n        className={cn(\n          'flex size-5 shrink-0 items-center justify-center border-2',\n          mode === 'radio' ? 'rounded-full' : 'rounded-sm',\n          selected ? 'border-primary bg-primary' : 'border-muted-foreground/50'\n        )}>\n        {selected ? <CheckIcon className=\"text-primary-foreground size-3\" strokeWidth={3} /> : null}\n      </span>\n    </button>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/kit/selectable-card.tsx"
    }
  ],
  "meta": {
    "exports": [
      "SelectableCard"
    ],
    "api": "<SelectableCard title description? icon? detail? selected onClick mode=\"radio|checkbox\" />"
  },
  "docs": "Needs the kit theme (`@kit/theme`) and a next-themes ThemeProvider (attribute=\"class\") at the root.",
  "categories": [
    "inputs"
  ],
  "type": "registry:component"
}