Skip to main content

toggle

Function toggle 

Source
pub fn toggle(
    key: impl Into<String>,
    pressed: bool,
    label: impl Into<String>,
) -> El
Expand description

A standalone two-state button. pressed paints the active surface (accent fill + accent foreground + semibold), unpressed renders as ghost. Click on the routed key key flips the bool — fold the event back with apply_event_pressed.