pub struct RadioGroup { /* private fields */ }Expand description
Radio buttons sharing a name, with a label, description and error.
let html = render_static(RadioGroup![label = "Plan", name = "plan", value = "pro",
Radio![value = "free", "Free"], Radio![value = "pro", "Pro"]]);
assert!(html.contains(r#"type="radio" checked name="plan" value="pro""#));Implementations§
Source§impl RadioGroup
impl RadioGroup
pub fn new() -> Self
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.
Sourcepub fn with(self, part: impl RadioGroupPart) -> Self
pub fn with(self, part: impl RadioGroupPart) -> Self
Add radios or attributes for the group; class(..) goes to the outer element.
pub fn label(self, v: impl Into<String>) -> Self
pub fn description(self, v: impl MaybeText) -> Self
pub fn error_message(self, v: impl MaybeText) -> Self
Sourcepub fn horizontal(self, v: bool) -> Self
pub fn horizontal(self, v: bool) -> Self
Lay the radios out in a row.
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
Trait Implementations§
Source§impl Default for RadioGroup
impl Default for RadioGroup
Auto Trait Implementations§
impl !RefUnwindSafe for RadioGroup
impl !Sync for RadioGroup
impl !UnwindSafe for RadioGroup
impl Forget for RadioGroup
impl Freeze for RadioGroup
impl Move for RadioGroup
impl Send for RadioGroup
impl Unpin for RadioGroup
impl UnsafeUnpin for RadioGroup
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