{
  "id": "settings-toggle-list",
  "name": "Settings Toggle List",
  "category": "forms",
  "tags": [
    "settings",
    "preferences",
    "toggle",
    "switch",
    "list",
    "notifications"
  ],
  "description": "A settings panel of rows with a title, a short description and a switch, where the whole row is clickable.",
  "url": "https://copy-css.com/snippets/settings-toggle-list",
  "markdown": "https://copy-css.com/snippets/settings-toggle-list.md",
  "html": "<fieldset class=\"settings-list\">\n  <legend>Notifications</legend>\n  <label>\n    <span><strong>Comments</strong>When someone replies to you</span>\n    <input type=\"checkbox\" role=\"switch\" checked>\n  </label>\n  <label>\n    <span><strong>Mentions</strong>When someone tags you</span>\n    <input type=\"checkbox\" role=\"switch\">\n  </label>\n  <label>\n    <span><strong>Weekly digest</strong>A summary every Monday</span>\n    <input type=\"checkbox\" role=\"switch\" checked>\n  </label>\n</fieldset>",
  "css": ".settings-list {\n  width: 100%;\n  max-width: 300px;\n  margin: 0;\n  padding: 0;\n  overflow: hidden;\n  border: 1px solid #e4e4e7;\n  border-radius: 14px;\n  background: #fff;\n  color: #18181b;\n  font-family: system-ui, sans-serif;\n}\n\n.settings-list legend {\n  float: left;\n  width: 100%;\n  padding: 12px 16px 4px;\n  color: #71717a;\n  font-size: 12px;\n  font-weight: 700;\n  letter-spacing: 0.06em;\n  text-transform: uppercase;\n}\n\n.settings-list label {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  gap: 12px;\n  clear: both;\n  padding: 10px 16px;\n  border-top: 1px solid #f4f4f5;\n  cursor: pointer;\n}\n\n.settings-list label:first-of-type {\n  border-top: 0;\n}\n\n.settings-list label:hover {\n  background: #fafafa;\n}\n\n.settings-list span {\n  display: grid;\n  color: #71717a;\n  font-size: 12px;\n}\n\n.settings-list strong {\n  color: #18181b;\n  font-size: 14px;\n  font-weight: 600;\n}\n\n.settings-list input {\n  position: relative;\n  flex: none;\n  width: 40px;\n  height: 24px;\n  margin: 0;\n  border-radius: 999px;\n  background: #d4d4d8;\n  -webkit-appearance: none;\n  appearance: none;\n  cursor: pointer;\n  transition: background 0.2s ease;\n}\n\n.settings-list input::before {\n  content: \"\";\n  position: absolute;\n  top: 3px;\n  left: 3px;\n  width: 18px;\n  height: 18px;\n  border-radius: 50%;\n  background: #fff;\n  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);\n  transition: transform 0.2s ease;\n}\n\n.settings-list input:checked {\n  background: #16a34a;\n}\n\n.settings-list input:checked::before {\n  transform: translateX(16px);\n}\n\n.settings-list input:focus-visible {\n  outline: 2px solid #16a34a;\n  outline-offset: 2px;\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .settings-list input,\n  .settings-list input::before {\n    transition: none;\n  }\n}",
  "features": [
    "transitions",
    "transforms",
    "box shadows",
    "CSS Grid",
    "Flexbox",
    "the :checked state (no JavaScript)",
    "keyboard focus styles",
    "reduced-motion support"
  ],
  "customProperties": []
}
