{
  "id": "custom-checkbox",
  "name": "Custom Checkbox",
  "category": "forms",
  "tags": [
    "checkbox",
    "check",
    "form",
    "appearance"
  ],
  "description": "A styled checkbox with a crisp checkmark, using appearance: none.",
  "url": "https://copy-css.com/snippets/custom-checkbox",
  "markdown": "https://copy-css.com/snippets/custom-checkbox.md",
  "html": "<label class=\"checkbox\">\n  <input type=\"checkbox\" checked>\n  Remember me\n</label>",
  "css": ".checkbox {\n  display: inline-flex;\n  align-items: center;\n  gap: 10px;\n  font: 16px system-ui, sans-serif;\n  cursor: pointer;\n}\n\n.checkbox input {\n  display: grid;\n  place-content: center;\n  width: 22px;\n  height: 22px;\n  margin: 0;\n  border: 2px solid #9ca3af;\n  border-radius: 6px;\n  -webkit-appearance: none;\n  appearance: none;\n  cursor: pointer;\n  transition: background 0.2s ease, border-color 0.2s ease;\n}\n\n.checkbox input::before {\n  content: \"\";\n  width: 12px;\n  height: 12px;\n  background: #fff;\n  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);\n  transform: scale(0);\n  transition: transform 0.15s ease;\n}\n\n.checkbox input:checked {\n  border-color: #6366f1;\n  background: #6366f1;\n}\n\n.checkbox input:checked::before {\n  transform: scale(1);\n}",
  "features": [
    "transitions",
    "transforms",
    "clip paths",
    "CSS Grid",
    "Flexbox",
    "the :checked state (no JavaScript)"
  ],
  "customProperties": []
}
