Switch

A control that allows the user to toggle between checked and unchecked.

Default

Click to toggle the switch on and off.

Airplane Mode

Checked

A switch that starts in the checked state.

Notifications enabled

Sizes

Default and small sizes.

Default
Small

Disabled

Disabled switches cannot be toggled.

Disabled off
Disabled on

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

PropTypeDefaultDescription
checkedBoolfalseInitial checked state
disabledBoolfalseDisable the switch
sizeString"default""default" or "sm"
classString""Additional CSS classes