Function freya::components::Switch  
source · pub fn Switch(props: SwitchProps) -> Result<VNode, RenderError>Expand description
Display whether a state is true or false.
Commonly used for enabled/disabled scenarios.
Example: light/dark theme.
§Styling
Inherits the SwitchTheme theme.
§Example
fn app() -> Element {
    let mut enabled = use_signal(|| false);
    rsx!(Switch {
        enabled: enabled(),
        ontoggled: move |_| {
            enabled.toggle();
        }
    })
}§Preview
| Enabled | Not Enabled | 
|---|---|