pub struct label;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>
}Trait Implementations§
Source§impl Component for label
impl Component for label
Source§type Props<'__props> = LabelProps<'__props>
type Props<'__props> = LabelProps<'__props>
The component’s properties. The lifetime covers data borrowed from
the caller.
Source§fn render<'__a, '__props>(
self,
cx: &'__a Cx,
props: Self::Props<'__props>,
) -> impl Future<Output = Result<impl View>> + Send + '__awhere
Self: '__a,
Self::Props<'__props>: '__a,
'__props: '__a,
fn render<'__a, '__props>(
self,
cx: &'__a Cx,
props: Self::Props<'__props>,
) -> impl Future<Output = Result<impl View>> + Send + '__awhere
Self: '__a,
Self::Props<'__props>: '__a,
'__props: '__a,
fn props_builder<'a>() -> <Self::Props<'a> as Props>::Builder
Auto Trait Implementations§
impl Freeze for label
impl RefUnwindSafe for label
impl Send for label
impl Sync for label
impl Unpin for label
impl UnsafeUnpin for label
impl UnwindSafe for label
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