{
 "id": "settings-toggles",
 "name": "Settings switches",
 "purpose": "A group of on and off settings, each with a plain explanation, including one that is locked by the organization.",
 "use_when": [
  "on a settings page with on and off options",
  "admin or security settings where some options are set by the organization and the person must see that they cannot change them"
 ],
 "avoid_when": [
  "a setting with more than two choices: use a select or radio group, as member-list does for roles",
  "choosing a paid plan: use plan-picker",
  "quick on and off controls for devices: use home-controls"
 ],
 "type": "form",
 "style": "quiet",
 "width": "medium",
 "tags": {
  "audience": "work",
  "industries": [
   "any"
  ],
  "keywords": [
   "settings",
   "switch",
   "toggle",
   "preferences",
   "form"
  ]
 },
 "root": ".odl-settings-toggles",
 "parts": [
  {
   "name": "title",
   "selector": "legend",
   "what": "the group's name",
   "slot": "text"
  },
  {
   "name": "settings",
   "selector": ".odl-row",
   "what": "one setting: name, explanation and its switch or lock; the whole row is the target",
   "slot": "list"
  },
  {
   "name": "name",
   "selector": ".odl-text > span",
   "what": "what the setting does",
   "slot": "text"
  },
  {
   "name": "help",
   "selector": ".odl-text small",
   "what": "a plain explanation of the effect",
   "slot": "text"
  },
  {
   "name": "switch",
   "selector": "input",
   "what": "a native checkbox shown as a switch",
   "slot": "input"
  },
  {
   "name": "locked_note",
   "selector": ".odl-text em",
   "what": "who set a locked setting",
   "slot": "text"
  },
  {
   "name": "locked",
   "selector": ".odl-locked",
   "what": "a locked setting's state in words with a lock, in place of the switch",
   "slot": "text"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "title",
   "settings"
  ],
  "properties": {
   "title": {
    "type": "string",
    "maxLength": 40,
    "part": "title"
   },
   "settings": {
    "type": "array",
    "minItems": 1,
    "maxItems": 8,
    "part": "settings",
    "items": {
     "type": "object",
     "required": [
      "name",
      "on"
     ],
     "properties": {
      "name": {
       "type": "string",
       "maxLength": 40,
       "part": "name"
      },
      "help": {
       "type": "string",
       "maxLength": 120,
       "part": "help"
      },
      "on": {
       "type": "boolean",
       "part": "switch"
      },
      "locked": {
       "type": "boolean",
       "part": "locked"
      },
      "locked_by": {
       "type": "string",
       "maxLength": 40,
       "part": "locked_note"
      },
      "key": {
       "type": "string",
       "maxLength": 40
      },
      "state_label": {
       "type": "string",
       "maxLength": 80
      }
     }
    }
   }
  }
 },
 "states": {
  "shown": [
   "on",
   "off",
   "locked",
   "hover",
   "focus"
  ],
  "edge": {
   "empty": {
    "status": "handled",
    "evidence": "data-od-list",
    "how": "the Smart UI renderer puts one plain 'Nothing to show yet.' line in an empty list"
   },
   "loading": {
    "status": "handled",
    "evidence": "data-od-slot",
    "how": "the Smart UI renderer draws each marked slot as a quiet block of its size while the data arrives; the static file shows the filled part"
   },
   "error": {
    "status": "not_built",
    "how": "if a change fails to save, flip the switch back and show the reason in toast-stack"
   },
   "disabled": {
    "status": "shown",
    "how": "a setting the organization locked shows its state in words with a lock, read as 'On, locked'; a disabled switch is also styled faded",
    "evidence": "<span class=\"odl-sr\">, locked</span>"
   },
   "overflow": {
    "status": "not_built",
    "how": "the group grows with every row; past about eight, split it into several groups with their own titles"
   },
   "long_text": {
    "status": "handled",
    "how": "names and explanations wrap beside the switch, the title breaks anywhere to fit, and the locked state never wraps",
    "evidence": "overflow-wrap: anywhere"
   },
   "missing_image": {
    "status": "none",
    "how": "the part has no photo"
   }
  }
 },
 "tokens": [
  "--ds-border-width-default",
  "--ds-color-bg-action-primary",
  "--ds-color-bg-neutral-subtle",
  "--ds-color-border-focus",
  "--ds-color-border-separator",
  "--ds-color-border-strong",
  "--ds-color-border-subtle",
  "--ds-color-surface-raised",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-tertiary",
  "--ds-elevation-raised",
  "--ds-focus-ring-offset",
  "--ds-focus-ring-width",
  "--ds-font-weight-label",
  "--ds-icon-stroke-md",
  "--ds-motion-duration-short",
  "--ds-motion-easing-standard",
  "--ds-opacity-disabled-container",
  "--ds-radius-container",
  "--ds-radius-control-sm",
  "--ds-radius-full",
  "--ds-size-icon-sm",
  "--ds-size-target-pointer",
  "--ds-space-2",
  "--ds-space-inline-xs",
  "--ds-space-inset-lg",
  "--ds-space-inset-md",
  "--ds-space-inset-sm",
  "--ds-space-inset-xl",
  "--ds-space-stack-xs",
  "--ds-text-body-md",
  "--ds-text-label-md",
  "--ds-text-title-md"
 ],
 "a11y": {
  "summary": "Native checkboxes with role switch inside their labels, so the whole row is the target; the switch is at least 24 px tall; a setting the organization locked shows its state in words with a lock and is read as \"On, locked\".",
  "roles": [
   "group",
   "switch"
  ],
  "keyboard": [
   "Tab reaches each switch in turn; locked settings have no control and are skipped",
   "Space turns the focused switch on or off"
  ],
  "controls": {
   "button": 0,
   "input": 3,
   "link": 0,
   "select": 0,
   "textarea": 0,
   "summary": 0
  },
  "focus_visible": true,
  "reduced_motion": true,
  "min_target": false
 },
 "files": {
  "html": "components/settings-toggles/component.html",
  "bytes": 6813,
  "script": false
 },
 "source": "brand/showcase/product/06-ferrule-security",
 "photos": 0,
 "urls": {
  "html": "https://opendesigner.dev/library/settings-toggles.html",
  "json": "https://opendesigner.dev/library/settings-toggles.json",
  "page": "https://opendesigner.dev/library/settings-toggles/"
 },
 "get": {
  "curl": "curl -fsSLo settings-toggles.html https://opendesigner.dev/library/settings-toggles.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add settings-toggles --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component settings-toggles to this project: https://opendesigner.dev/library/settings-toggles.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
