{
  "id": "@typed/ui#Switch.Switch",
  "canonicalId": "@typed/ui/Switch#Switch",
  "symbol": {
    "id": "@typed/ui#Switch.Switch",
    "packageName": "@typed/ui",
    "moduleName": ".",
    "exportName": "Switch.Switch",
    "kind": "function",
    "signatures": [
      "export declare function Switch<const Options extends SwitchOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, SwitchInternalProps<Options>>, Options[\"content\"], Host>): import(\"./Dom/Types.js\").HostComponent<Options | Host>;"
    ],
    "summary": "Renders a button-backed ARIA switch.",
    "sections": {},
    "examples": [
      {
        "language": "ts",
        "code": "import { RefSubject } from \"@typed/fx\";\nimport { html } from \"@typed/template\";\nimport { component } from \"@typed/ui/Component\";\nimport * as Switch from \"@typed/ui/Switch\";\n\nexport const PreviewSetting = component(function* () {\n  const state = yield* Switch.makeState({ checked: true });\n  const status = RefSubject.map(state, ({ checked }) => checked ? \"On\" : \"Off\");\n  return html`<section>\n    ${Switch.Switch({\n      state,\n      content: \"Show live preview\",\n      props: { class: \"preview-switch\", \"aria-describedby\": \"preview-setting-help\" },\n    })}\n    <span aria-hidden=\"true\">${status}</span>\n    <p id=\"preview-setting-help\">Updates the preview while you edit.</p>\n  </section>`;\n});"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/ui/src/Switch.ts",
      "line": 167
    },
    "since": "1.0.0",
    "category": "Native controls"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/ui#Switch.Switch",
    "packageName": "@typed/ui",
    "packageVersion": "1.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/ui",
    "exportName": "Switch",
    "qualifiedName": "Switch.Switch",
    "declarationKey": "declaration:3db5b24b15d17dd849153718",
    "family": "function",
    "signatures": [
      "export declare function Switch<const Options extends SwitchOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, SwitchInternalProps<Options>>, Options[\"content\"], Host>): import(\"./Dom/Types.js\").HostComponent<Options | Host>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/ui/src/Switch.ts",
        "start": {
          "line": 167,
          "column": 1
        },
        "end": {
          "line": 184,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/ui/Switch#Switch",
      "@typed/ui/index#Switch.Switch"
    ],
    "isAlias": true,
    "parentId": "@typed/ui#Switch",
    "static": false,
    "importedFrom": "declaration:3db5b24b15d17dd849153718"
  },
  "declaration": {
    "declarationKey": "declaration:3db5b24b15d17dd849153718",
    "name": "Switch",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function Switch<const Options extends SwitchOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, SwitchInternalProps<Options>>, Options[\"content\"], Host>): import(\"./Dom/Types.js\").HostComponent<Options | Host>;"
        ],
        "typeParameters": [
          "const Options extends SwitchOptions",
          "const Host extends HostResult = never"
        ],
        "sourceSpans": [
          {
            "file": "packages/ui/src/Switch.ts",
            "start": {
              "line": 167,
              "column": 1
            },
            "end": {
              "line": 184,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function Switch<const Options extends SwitchOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, SwitchInternalProps<Options>>, Options[\"content\"], Host>): import(\"./Dom/Types.js\").HostComponent<Options | Host>;"
    ],
    "typeParameters": [
      "const Options extends SwitchOptions",
      "const Host extends HostResult = never"
    ],
    "summary": "Renders a button-backed ARIA switch.",
    "sections": {},
    "examples": [
      {
        "language": "ts",
        "code": "import { RefSubject } from \"@typed/fx\";\nimport { html } from \"@typed/template\";\nimport { component } from \"@typed/ui/Component\";\nimport * as Switch from \"@typed/ui/Switch\";\n\nexport const PreviewSetting = component(function* () {\n  const state = yield* Switch.makeState({ checked: true });\n  const status = RefSubject.map(state, ({ checked }) => checked ? \"On\" : \"Off\");\n  return html`<section>\n    ${Switch.Switch({\n      state,\n      content: \"Show live preview\",\n      props: { class: \"preview-switch\", \"aria-describedby\": \"preview-setting-help\" },\n    })}\n    <span aria-hidden=\"true\">${status}</span>\n    <p id=\"preview-setting-help\">Updates the preview while you edit.</p>\n  </section>`;\n});"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/ui/src/Switch.ts",
        "start": {
          "line": 167,
          "column": 1
        },
        "end": {
          "line": 184,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Native controls"
  }
}
