{
  "_copyright": "Copyright (c) 2026, Salesforce, Inc., All rights reserved. For full license text, see the LICENSE.txt file",
  "$schema": "https://slds.lightningdesignsystem.com/schemas/uif-foundation.v1.json",
  "apiVersion": "1.0.0",
  "name": "CheckboxToggle",
  "description": "Initializes checkbox toggle",
  "structure": {
    "name": "root",
    "restrict": [
      "div"
    ],
    "description": "Form element wrapper",
    "children": [
      {
        "name": "toggle",
        "restrict": [
          "label"
        ],
        "description": "Initializes checkbox toggle",
        "children": [
          {
            "name": "formLabel",
            "restrict": [
              "span"
            ],
            "description": "Visible toggle label text",
            "slot": {
              "name": "label",
              "required": true
            }
          },
          {
            "name": "input",
            "restrict": [
              "input"
            ],
            "description": "Native checkbox input",
            "attributes": {
              "static": {
                "type": "checkbox",
                "role": "switch"
              },
              "bound": {
                "id": {
                  "prop": "inputId"
                },
                "name": {
                  "prop": "name"
                },
                "value": {
                  "prop": "value"
                },
                "checked": {
                  "prop": "checked"
                },
                "disabled": {
                  "prop": "disabled"
                },
                "aria-describedby": {
                  "prop": "ariaDescribedBy"
                }
              }
            }
          },
          {
            "name": "fauxContainer",
            "restrict": [
              "span"
            ],
            "description": "Container for faux checkbox element",
            "attributes": {
              "bound": {
                "id": {
                  "prop": "inputId"
                }
              }
            },
            "children": [
              {
                "name": "faux",
                "restrict": [
                  "span"
                ],
                "description": "Creates a custom styled checkbox"
              },
              {
                "name": "activeLabel",
                "restrict": [
                  "span"
                ],
                "description": "Container for text to show when checkbox is toggle on"
              },
              {
                "name": "inactiveLabel",
                "restrict": [
                  "span"
                ],
                "description": "Container for text to show when checkbox is toggle off"
              }
            ]
          }
        ]
      }
    ]
  },
  "states": [
    {
      "name": "checked",
      "type": "boolean",
      "aria": "aria-checked",
      "description": "Whether the toggle is on"
    },
    {
      "name": "disabled",
      "type": "boolean",
      "aria": "aria-disabled",
      "description": "Whether the toggle is disabled"
    },
    {
      "name": "required",
      "type": "boolean",
      "aria": "aria-required",
      "description": "Whether the toggle is required"
    }
  ],
  "accessibility": {
    "requirements": [
      {
        "id": "switch-role",
        "description": "Toggle must have role='switch'"
      },
      {
        "id": "label-association",
        "description": "Toggle must have an associated label"
      }
    ]
  }
}
