# Switch ## Example ```svelte
(checked2 = !checked2)} /> (checked = !checked)} />

With Label

``` ## Documentation ## Usage ```svelte ``` ## Sources This component uses the bits-ui component: Switch, see here for the documentation for that: https://bits-ui.com/docs/components/switch/llms.txt ## API Reference ### Switch A toggle control that switches between on and off states. Built on top of the bits-ui Switch primitive. | Prop | Type | Default | Description | |------|------|---------|-------------| | checked | `boolean` | `false` | Whether the switch is checked (on). (bindable) | | onCheckedChange | `(checked: boolean) => void` | `-` | A callback invoked when the checked state changes. | | disabled | `boolean` | `false` | Whether the switch is disabled. | | name | `string` | `-` | The name of the switch used in form submission. | | required | `boolean` | `false` | Whether the switch is required. | | value | `string` | `-` | The value of the switch used in form submission. | | class | `string` | `-` | Additional CSS classes to apply. | | ref | `HTMLElement` | `-` | The underlying DOM element. (bindable) |