- Implementation
- FieldLabel Props
Common Examples
TheFieldLabel component is typically used internally by form components, but can also be used directly when building custom form fields.Required Fields
Add a visual required indicator (red asterisk) and screen reader announcement.With More Info Tooltip
Add additional context with a help tooltip.Polymorphic Element
TheFieldLabel component can render as different HTML elements using the el prop. Choose the element based on whether you are labeling a single control or a group of related controls.Use
el="legend" when building a custom fieldset (for example a group of native inputs or third-party controls that share one accessible name). Prefer the built-in legend prop on Checkbox.Group and Radio.Group instead of composing FieldLabel yourself for those components.Controlled Tooltip State
Control the tooltip’s open state programmatically.Markdown in labels
Thechildren prop supports limited inline Markdown: bold (**text**), italic (*text*), bold and italic (***text***), highlight (==text==), and code (`text`). This markdown is stripped from the accessible text so screen readers receive a plain string.React Accessibility
- Uses semantic HTML (
<label>by default, or<legend>whenel="legend") - Required fields include both a visual asterisk and “Required” text for screen readers
- The
moreInfocontent is available to screen readers viaSrOnly - Associates with a single control via
htmlForwhenel="label"; as a<legend>, associates with the enclosing<fieldset>group instead