adam_web_ui/components/switch/
component.rs1use dioxus::prelude::*;
3use dioxus_primitives::switch::{self, SwitchProps};
4
5include!(concat!(env!("OUT_DIR"), "/switch-styles.rs"));
6
7#[component]
18pub fn Switch(props: SwitchProps) -> Element {
19 crate::components::styles::use_control_styles();
20 rsx! {
21 switch::Switch {
22 class: Styles::dx_switch,
23 checked: props.checked,
24 default_checked: props.default_checked,
25 disabled: props.disabled,
26 required: props.required,
27 name: props.name,
28 value: props.value,
29 on_checked_change: props.on_checked_change,
30 attributes: props.attributes,
31 switch::SwitchThumb { class: Styles::dx_switch_thumb }
32 }
33 }
34}