pub struct CheckboxProps {
pub attrs: Attributes,
}Expand description
A styled native checkbox.
Pass input attributes and event handlers through attrs. Classes apply to the
wrapper, while other attributes go on the <input>. Use checked for the initial
state. The indeterminate state requires setting a DOM property and has no custom
styling.
ⓘ
view! {
<div class="flex items-center gap-2">
let terms = element_id(cx);
checkbox(attrs: attributes! { id=(&terms) name="terms" checked="" })
label(attrs: attributes! { for=(&terms) }, "Accept terms")
</div>
}Fields§
§attrs: AttributesImplementations§
Source§impl CheckboxProps
impl CheckboxProps
Sourcepub fn builder() -> CheckboxPropsBuilder
pub fn builder() -> CheckboxPropsBuilder
Returns a CheckboxPropsBuilder with no properties set.
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 UnsafeUnpin 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