{
  "id": "checkbox-tiles",
  "name": "Checkbox Tiles",
  "category": "forms",
  "tags": [
    "checkbox",
    "tiles",
    "multi-select",
    "icons",
    "has",
    "options grid"
  ],
  "description": "Large icon tiles for picking several options at once, each a real checkbox with a corner check badge.",
  "url": "https://copy-css.com/snippets/checkbox-tiles",
  "markdown": "https://copy-css.com/snippets/checkbox-tiles.md",
  "html": "<fieldset class=\"check-tiles\">\n  <legend>What are you building?</legend>\n  <label>\n    <input type=\"checkbox\" checked>\n    <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><rect x=\"3\" y=\"4\" width=\"18\" height=\"14\" rx=\"2\"/><path d=\"M8 21h8M12 18v3\"/></svg>\n    Website\n  </label>\n  <label>\n    <input type=\"checkbox\">\n    <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><rect x=\"7\" y=\"2\" width=\"10\" height=\"20\" rx=\"2\"/><path d=\"M11 18h2\"/></svg>\n    Mobile app\n  </label>\n  <label>\n    <input type=\"checkbox\" checked>\n    <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M4 7h16M4 12h16M4 17h10\"/></svg>\n    Docs\n  </label>\n</fieldset>",
  "css": ".check-tiles {\n  display: grid;\n  grid-template-columns: repeat(3, 1fr);\n  gap: 8px;\n  width: 100%;\n  max-width: 300px;\n  margin: 0;\n  padding: 0;\n  border: 0;\n  font-family: system-ui, sans-serif;\n}\n\n.check-tiles legend {\n  margin-bottom: 8px;\n  padding: 0;\n  color: #1e3a8a;\n  font-size: 14px;\n  font-weight: 700;\n}\n\n.check-tiles label {\n  position: relative;\n  display: grid;\n  justify-items: center;\n  gap: 6px;\n  padding: 14px 6px 12px;\n  border: 1.5px solid #dbeafe;\n  border-radius: 12px;\n  background: #fff;\n  color: #334155;\n  font-size: 13px;\n  font-weight: 600;\n  text-align: center;\n  cursor: pointer;\n  transition: border-color 0.2s ease, background 0.2s ease;\n}\n\n.check-tiles svg {\n  width: 26px;\n  height: 26px;\n  fill: none;\n  stroke: currentColor;\n  stroke-width: 1.8;\n  stroke-linecap: round;\n  stroke-linejoin: round;\n}\n\n.check-tiles input {\n  position: absolute;\n  top: 6px;\n  right: 6px;\n  display: grid;\n  place-items: center;\n  width: 18px;\n  height: 18px;\n  margin: 0;\n  border: 1.5px solid #bfdbfe;\n  border-radius: 50%;\n  -webkit-appearance: none;\n  appearance: none;\n}\n\n.check-tiles input:checked {\n  border-color: #2563eb;\n  background: #2563eb;\n}\n\n.check-tiles input:checked::before {\n  content: \"✓\";\n  color: #fff;\n  font-size: 11px;\n  font-weight: 900;\n}\n\n.check-tiles label:has(:checked) {\n  border-color: #2563eb;\n  background: #eff6ff;\n  color: #1d4ed8;\n}\n\n.check-tiles label:has(:focus-visible) {\n  outline: 2px solid #2563eb;\n  outline-offset: 2px;\n}",
  "features": [
    "transitions",
    "CSS Grid",
    "the :has() selector",
    "the :checked state (no JavaScript)",
    "keyboard focus styles"
  ],
  "customProperties": []
}
