Skip to content

Switch

A switch that toggles on when clicked, or with Space while focused.

ui.switch

Basic

ui.switch(&mut self.notify, "Notifications");

Disabled

ui.column().gap(8).children(|ui| {
ui.switch(&mut self.sync, "On").disabled(true);
ui.switch(&mut self.offline, "Off").disabled(true);
});