Function freya_components::Switch
source · pub fn Switch(props: SwitchProps) -> ElementExpand 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();
}
}
)
}