{
  "id": "radio-cards",
  "name": "Radio Cards",
  "category": "forms",
  "tags": [
    "radio",
    "cards",
    "choice",
    "has",
    "selection"
  ],
  "description": "Large, clickable option cards built on real radio buttons, highlighted with :has().",
  "url": "https://copy-css.com/snippets/radio-cards",
  "markdown": "https://copy-css.com/snippets/radio-cards.md",
  "html": "<div class=\"radio-cards\">\n  <label><input type=\"radio\" name=\"plan\" checked><strong>Monthly</strong><span>$9 / month</span></label>\n  <label><input type=\"radio\" name=\"plan\"><strong>Yearly</strong><span>$90 / year</span></label>\n</div>",
  "css": ".radio-cards {\n  display: flex;\n  gap: 10px;\n  font-family: system-ui, sans-serif;\n}\n\n.radio-cards label {\n  position: relative;\n  display: grid;\n  flex: 1 1 0;\n  gap: 2px;\n  min-width: 0;\n  padding: 14px 16px;\n  border: 2px solid #e2e8f0;\n  border-radius: 12px;\n  background: #fff;\n  cursor: pointer;\n  transition: border-color 0.15s ease, background 0.15s ease;\n}\n\n/* Keep the radio accessible but invisible */\n.radio-cards input {\n  position: absolute;\n  opacity: 0;\n}\n\n.radio-cards strong {\n  color: #0f172a;\n  font-size: 15px;\n}\n\n.radio-cards span {\n  color: #64748b;\n  font-size: 13px;\n}\n\n.radio-cards label:has(:checked) {\n  border-color: #0ea5e9;\n  background: #f0f9ff;\n}\n\n.radio-cards label:has(:focus-visible) {\n  outline: 2px solid #0ea5e9;\n  outline-offset: 2px;\n}",
  "features": [
    "transitions",
    "CSS Grid",
    "Flexbox",
    "the :has() selector",
    "the :checked state (no JavaScript)",
    "keyboard focus styles"
  ],
  "customProperties": []
}
