Switch
llms.txtExample
With Label
Usage
<Switch bind:checked />
API Reference
Switch
A toggle control that switches between on and off states. Built on top of the bits-ui Switch primitive.
Property Type Description
checked $bindable
boolean
Whether the switch is checked (on). Default:
falseonCheckedChange
function
A callback invoked when the checked state changes. Default: —
disabled
boolean
Whether the switch is disabled. Default:
falsename
string
The name of the switch used in form submission. Default: —
required
boolean
Whether the switch is required. Default:
falsevalue
string
The value of the switch used in form submission. Default: —
class
string
Additional CSS classes to apply. Default: —
ref $bindable
HTMLElement
The underlying DOM element. Default: —
Property
checked
onCheckedChange
disabled
name
required
value
class
ref