pub struct LabelProps {
pub id: Option<Rc<str>>,
pub meta: Option<FieldMeta>,
pub invalid: Option<bool>,
pub disabled: Option<bool>,
pub required: Option<bool>,
pub attributes: Vec<Attribute>,
pub children: Element,
}Expand description
Props for the headless Label part.
Fields§
§id: Option<Rc<str>>The rendered label’s own id, registered with the resolved metadata for this part’s
lifetime. Defaults to a generated id.
The control reaches this id through aria-labelledby, which is the only naming path
available to a control rooted on an element <label for> cannot address — for requires a
labelable element, and widgets rooted on a div are not one.
meta: Option<FieldMeta>Explicit metadata, which wins over Field Context metadata.
invalid: Option<bool>Explicit invalid state, which wins over the metadata state.
disabled: Option<bool>Explicit disabled state, which wins over the metadata state.
required: Option<bool>Explicit required state, which wins over the metadata state.
attributes: Vec<Attribute>Attributes forwarded to the rendered label.
Sorted by attribute name and deduplicated with the part’s own, which dioxus-core requires
of any spread list. A forwarded attribute wins its name.
children: ElementLabel content.
Implementations§
Source§impl LabelProps
impl LabelProps
Sourcepub fn builder() -> LabelPropsBuilder<((), (), (), (), (), (), ())>
pub fn builder() -> LabelPropsBuilder<((), (), (), (), (), (), ())>
Create a builder for building LabelProps.
On the builder, call .id(...)(optional), .meta(...)(optional), .invalid(...)(optional), .disabled(...)(optional), .required(...)(optional), .attributes(...)(optional), .children(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of LabelProps.
Trait Implementations§
Source§impl Clone for LabelProps
impl Clone for LabelProps
Source§fn clone(&self) -> LabelProps
fn clone(&self) -> LabelProps
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more