Function freya::prelude::Switch

pub fn Switch(props: SwitchProps) -> Option<VNode>
Expand description

Controlled Switch component.

§Props

See SwitchProps.

§Styling

Inherits the SwitchTheme theme.

§Example

fn app() -> Element {
    let mut enabled = use_signal(|| false);

    rsx!(
        Switch {
            enabled: *enabled.read(),
            ontoggled: move |_| {
                enabled.toggle();
            }
        }
    )
}