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.
Properties
Section titled “Properties”checked
Section titled “checked” bool (in-out) default: false
Whether the switch is checked (on) or not (off).
Switch { checked: true;}slint
enabled
Section titled “enabled” bool default: true
Defaults to true. When false, the switch can’t be toggled.
tooltip
Section titled “tooltip”on_icon
Section titled “on_icon” image default: the empty image
The icon to show when the switch is checked (on).
Switch { on_icon: @image-url("icon_on.png");}slint
off_icon
Section titled “off_icon” 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
Callbacks
Section titled “Callbacks”toggled()
Section titled “toggled()”The switch value changed
Switch { changed checked => { debug("Switch checked: ", self.checked); }}slint
© 2025 SixtyFPS GmbH