pub struct Checkbox { /* private fields */ }Expand description
A checkbox with a label.
let html = render_static(Checkbox![name = "terms", required = true, "I agree"]);
assert!(html.contains(r#"<input class="nr-checkbox-input" type="checkbox" required name="terms">"#));Implementations§
Source§impl Checkbox
impl Checkbox
pub fn new() -> Self
pub fn name(self, v: impl Into<String>) -> Self
pub fn checked(self, v: bool) -> Self
pub fn disabled(self, v: bool) -> Self
pub fn required(self, v: bool) -> Self
pub fn color(self, v: Color) -> Self
pub fn size(self, v: Size) -> Self
pub fn radius(self, v: Radius) -> Self
Sourcepub fn description(self, v: impl MaybeText) -> Self
pub fn description(self, v: impl MaybeText) -> Self
Secondary text under the label.
Sourcepub fn class(self, v: impl Into<String>) -> Self
pub fn class(self, v: impl Into<String>) -> Self
Extra classes for the outer element. They win over the defaults.
pub fn unstyled(self, v: bool) -> Self
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Checkbox
impl !Sync for Checkbox
impl !UnwindSafe for Checkbox
impl Forget for Checkbox
impl Freeze for Checkbox
impl Move for Checkbox
impl Send for Checkbox
impl Unpin for Checkbox
impl UnsafeUnpin for Checkbox
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