Switch
A control that allows the user to toggle between checked and unchecked.
Default
Click to toggle the switch on and off.
Checked
A switch that starts in the checked state.
Sizes
Default and small sizes.
Disabled
Disabled switches cannot be toggled.
With Label
Switch paired with a label.
Usage
julia
using Suite
Switch()
Switch(checked=true)
Switch(size="sm", disabled=true)
# With a label
Div(
Switch(:id => "notifications"),
Label(:htmlFor => "notifications", "Enable notifications"),
)API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| checked | Bool | false | Initial checked state |
| disabled | Bool | false | Disable the switch |
| size | String | "default" | "default" or "sm" |
| class | String | "" | Additional CSS classes |