pub struct CheckboxProps {Show 13 fields
pub name: MaybeProp<String>,
pub checked: MaybeProp<CheckedState>,
pub default_checked: MaybeProp<CheckedState>,
pub on_checked_change: Option<Callback<CheckedState>>,
pub required: MaybeProp<bool>,
pub disabled: MaybeProp<bool>,
pub value: MaybeProp<String>,
pub on_keydown: Option<Callback<KeyboardEvent>>,
pub on_click: Option<Callback<MouseEvent>>,
pub as_child: MaybeProp<bool>,
pub node_ref: NodeRef<AnyElement>,
pub attrs: Vec<(&'static str, Attribute)>,
pub children: ChildrenFn,
}
Expand description
Props for the Checkbox
component.
§Required Props
- attrs: [
Vec<(&'static str, Attribute)>
] - children:
ChildrenFn
§Optional Props
- name:
impl Into<MaybeProp<String>>
- checked:
impl Into<MaybeProp<CheckedState>>
- default_checked:
impl Into<MaybeProp<CheckedState>>
- on_checked_change:
impl Into<Callback<CheckedState>>
- required:
impl Into<MaybeProp<bool>>
- disabled:
impl Into<MaybeProp<bool>>
- value:
impl Into<MaybeProp<String>>
- on_keydown:
impl Into<Callback<KeyboardEvent>>
- on_click:
impl Into<Callback<MouseEvent>>
- as_child:
impl Into<MaybeProp<bool>>
- node_ref:
NodeRef<AnyElement>
Fields§
§name: MaybeProp<String>
§checked: MaybeProp<CheckedState>
§default_checked: MaybeProp<CheckedState>
§on_checked_change: Option<Callback<CheckedState>>
§required: MaybeProp<bool>
§disabled: MaybeProp<bool>
§value: MaybeProp<String>
§on_keydown: Option<Callback<KeyboardEvent>>
§on_click: Option<Callback<MouseEvent>>
§as_child: MaybeProp<bool>
§node_ref: NodeRef<AnyElement>
§attrs: Vec<(&'static str, Attribute)>
§children: ChildrenFn
Implementations§
Source§impl CheckboxProps
impl CheckboxProps
Sourcepub fn builder() -> CheckboxPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> CheckboxPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building CheckboxProps
.
On the builder, call .name(...)
(optional), .checked(...)
(optional), .default_checked(...)
(optional), .on_checked_change(...)
(optional), .required(...)
(optional), .disabled(...)
(optional), .value(...)
(optional), .on_keydown(...)
(optional), .on_click(...)
(optional), .as_child(...)
(optional), .node_ref(...)
(optional), .attrs(...)
(optional), .children(...)
to set the values of the fields.
Finally, call .build()
to create the instance of CheckboxProps
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CheckboxProps
impl !RefUnwindSafe for CheckboxProps
impl !Send for CheckboxProps
impl !Sync for CheckboxProps
impl Unpin for CheckboxProps
impl !UnwindSafe for CheckboxProps
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more