<FieldLabel
el="label"
htmlFor="input-id"
required={true}
moreInfo="Additional context for users"
>
Label Text
</FieldLabel>
FieldLabel Props
The FieldLabel component is polymorphic and accepts props based on the element type specified by el. In addition to standard HTML attributes for the chosen element, it accepts:el
ElementType
default:"label"
The HTML element to render. Common values: "label" (default), "legend".
Unique identifier for the label element.
Additional information to display in a tooltip next to the label text.
Controls the open state of the more info tooltip.
Whether the field is required. Shows a red asterisk (*) and announces “Required” to screen readers.
When el="label" (default)
Standard label props are available:The ID of the form element this label is associated with.
When el="legend"
Standard legend props are available. Typically used within a <fieldset>.