Label
A standalone form label, for when you need to place a label on its own.
Associating a form control
Clicking the label to focus/activate the control relies on the native <label>'s htmlFor association. The channel depends on the component — an id landed on the wrong element fails silently:
- TextInput family (including MultilineTextInput, NumberInput, ComboBoxInput, etc.):
idlands on the root div; to reach the native input, pass it throughinputProps={{ id }}. - CheckboxInput / RadioInput: there is no
inputPropschannel — use the dedicatedinputIdprop, which lands directly on the native<input>.
Inside a form, FieldLayout wires this automatically; no hand wiring needed.
In a form, the layout, alignment and click-to-focus linkage of "label + control" are usually handled by FieldLayout; writing htmlFor/id by hand suits free-form composition.
Visual hiding and title
invisibleLabel hides the label content visually (clipped, not removed — screen readers still announce it). title falls back to the label text when not given explicitly.
Disabled state
disabled outputs oo-ui-widget-disabled and aria-disabled; the theme dims the label.
Structure
The component renders a single <label>; the ref points to it, and undeclared props (htmlFor, title, events, etc.) pass straight through to that element.
API
See also
- Label layout and association for form fields: FieldLayout
- Inline labels built into input components: the "Label" section of TextInput