pub struct LabelProps<'__a> {
pub attrs: Attributes,
pub child: Child<'__a>,
}Expand description
A label for a form control.
Wrap the control or pass a for attribute matching its id. Create the id with
element_id. Pass the label text as children. attrs
are forwarded to the <label>, with extra classes added to its classes.
ⓘ
view! {
<div class="flex flex-col gap-2">
let email = element_id(cx);
label(attrs: attributes! { for=(&email) }, "Email")
input(attrs: attributes! { id=(&email) type="email" })
</div>
}Fields§
§attrs: Attributes§child: Child<'__a>Implementations§
Source§impl<'__a> LabelProps<'__a>
impl<'__a> LabelProps<'__a>
Sourcepub fn builder() -> LabelPropsBuilder<'__a>
pub fn builder() -> LabelPropsBuilder<'__a>
Returns a LabelPropsBuilder with no properties set.
Trait Implementations§
Auto Trait Implementations§
impl<'__a> !RefUnwindSafe for LabelProps<'__a>
impl<'__a> !Sync for LabelProps<'__a>
impl<'__a> !UnwindSafe for LabelProps<'__a>
impl<'__a> Freeze for LabelProps<'__a>
impl<'__a> Send for LabelProps<'__a>
impl<'__a> Unpin for LabelProps<'__a>
impl<'__a> UnsafeUnpin for LabelProps<'__a>
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