pub struct SwitchProps {
pub field: String,
pub label: String,
pub description: Option<String>,
pub checked: Option<bool>,
pub data_path: Option<String>,
pub required: Option<bool>,
pub disabled: Option<bool>,
pub error: Option<String>,
pub action: Option<Action>,
pub compact: Option<bool>,
}Expand description
Props for Switch component.
Fields§
§field: StringForm field name for data binding.
label: String§description: Option<String>§checked: Option<bool>§data_path: Option<String>Data path for pre-filling from handler data (e.g., “/data/user/name”).
required: Option<bool>§disabled: Option<bool>§error: Option<String>§action: Option<Action>Auto-submit action. When set, the switch renders inside a minimal form and submits on change.
compact: Option<bool>When true, applies scale-75 origin-left CSS to the switch container
for compact inline display (e.g. per-row settings toggles).
Trait Implementations§
Source§impl Clone for SwitchProps
impl Clone for SwitchProps
Source§fn clone(&self) -> SwitchProps
fn clone(&self) -> SwitchProps
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SwitchProps
impl Debug for SwitchProps
Source§impl<'de> Deserialize<'de> for SwitchProps
impl<'de> Deserialize<'de> for SwitchProps
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for SwitchProps
impl JsonSchema for SwitchProps
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for SwitchProps
impl PartialEq for SwitchProps
Source§fn eq(&self, other: &SwitchProps) -> bool
fn eq(&self, other: &SwitchProps) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for SwitchProps
impl Serialize for SwitchProps
impl StructuralPartialEq for SwitchProps
Auto Trait Implementations§
impl Freeze for SwitchProps
impl RefUnwindSafe for SwitchProps
impl Send for SwitchProps
impl Sync for SwitchProps
impl Unpin for SwitchProps
impl UnsafeUnpin for SwitchProps
impl UnwindSafe for SwitchProps
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more