pub struct SwitchProps {Show 14 fields
pub model_value: bool,
pub disabled: bool,
pub loading: bool,
pub size: SwitchSize,
pub width: Option<String>,
pub inline_prompt: bool,
pub active_text: Option<String>,
pub inactive_text: Option<String>,
pub active_icon: Option<String>,
pub inactive_icon: Option<String>,
pub name: Option<String>,
pub on_change: Option<EventHandler<bool>>,
pub class: Option<String>,
pub style: Option<String>,
}Expand description
Switch props
Fields§
§model_value: boolWhether the switch is active
disabled: boolWhether the switch is disabled
loading: boolWhether the switch is in loading state
size: SwitchSizeSwitch size
width: Option<String>Switch width (e.g., “40px”)
inline_prompt: boolWhether to show text inside the dot
active_text: Option<String>Text displayed when in “on” state
inactive_text: Option<String>Text displayed when in “off” state
active_icon: Option<String>Icon CSS class when in “on” state
inactive_icon: Option<String>Icon CSS class when in “off” state
name: Option<String>Input name attribute
on_change: Option<EventHandler<bool>>Change event handler (receives new value)
class: Option<String>Additional CSS classes
style: Option<String>Inline styles
Implementations§
Source§impl SwitchProps
impl SwitchProps
Sourcepub fn builder() -> SwitchPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> SwitchPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building SwitchProps.
On the builder, call .model_value(...)(optional), .disabled(...)(optional), .loading(...)(optional), .size(...)(optional), .width(...)(optional), .inline_prompt(...)(optional), .active_text(...)(optional), .inactive_text(...)(optional), .active_icon(...)(optional), .inactive_icon(...)(optional), .name(...)(optional), .on_change(...)(optional), .class(...)(optional), .style(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of SwitchProps.
Trait Implementations§
Source§impl Clone for SwitchProps
impl Clone for SwitchProps
Source§fn clone(&self) -> SwitchProps
fn clone(&self) -> SwitchProps
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl PartialEq for SwitchProps
impl PartialEq for SwitchProps
Source§fn eq(&self, other: &SwitchProps) -> bool
fn eq(&self, other: &SwitchProps) -> bool
self and other values to be equal, and is used by ==.