Toggle
llms.txtExample
Usage
<Toggle bind:pressed>Toggle</Toggle>
API Reference
Toggle
A two-state button that can be toggled on or off. Built on top of the bits-ui Toggle primitive.
Property Type Description
pressed $bindable
boolean
Whether the toggle is pressed. Default:
falseonPressedChange
function
A callback invoked when the pressed state changes. Default: —
variant
enum
The visual variant of the toggle. Default:
'default'size
enum
The size of the toggle. Default:
'default'disabled
boolean
Whether the toggle is disabled. Default:
falseclass
string
Additional CSS classes to apply. Default: —
ref $bindable
HTMLElement
The underlying DOM element. Default: —
Property
pressed
onPressedChange
variant
size
disabled
class
ref