Components / Selection & input
Toggle
Markdown crates/ui/src/widgets/controls.rs docs.rs
use ui::widgets::Controls;
theme.toggle(self.enabled)Display-only, like the rest of widgets: the caller adds .id(..) and .on_click(..), and holds the bool.
Keyboard
focus::focusable(&theme, &self.switch, theme.toggle(self.enabled))API
pub trait Controls: ThemeExt {
fn toggle(&self, on: bool) -> Div;
// ...
}