⌂
›
Reference
›
Switch
Switch
A material on/off toggle.
Example
switch(
label: "Email notifications",
value: true,
on_change: ->(event) { settings.notify = event.control.value }
)
Common properties
value—true/falselabellabel_position—"left"or"right"active_color/active_track_colorinactive_thumb_color/inactive_track_colorthumb_color/thumb_icontrack_color
Usage
toggle = switch(label: "Dark mode", value: false)
# later:
toggle.value # => false