Skip to content

Switch

Use a Switch to let the user toggle between on and off states, for example to enable or disable a feature. Consider using a CheckBox element instead if the action resembles more a selection of options.

bool (in-out) default: false

Whether the switch is checked (on) or not (off).

Switch {
checked: true;
}
slint

bool default: true

Defaults to true. When false, the switch can’t be toggled.

string default: ""

The tooltip text for the switch.

Switch {
tooltip: "Toggle me";
}
slint

image default: the empty image

The icon to show when the switch is checked (on).

Switch {
on_icon: @image-url("icon_on.png");
}
slint

image default: the empty image

The icon to show when the switch is not checked (off).

Switch {
off_icon: @image-url("icon_off.png");
}
slint

The switch value changed

Switch {
changed checked => {
debug("Switch checked: ", self.checked);
}
}
slint

© 2025 SixtyFPS GmbH