Components
Text Field
A field is a label, a control and whatever the control needs to say. Labels sit flush with the control's edge; helper text and errors never share a line.
Usage
Every text control that needs a label, help and an error.
Do and don't
- Do. Link the label and error to the control with htmlFor and aria-describedby.
- Don't. Use the placeholder as a label or show help and error together.
Composition
Field is the wrapper. Put one of Input, Textarea, Combobox or Selectinside it. There is no separate Input documentation; the control's own props are standard input attributes plus size="default" | "compact".
Contract
FieldLabelis a real<label>tied to its control byhtmlFor.FieldDescriptionandFieldErrorlink througharia-describedby, so a screen reader reads them on focus.- Errors announce via
role="alert". Exactly one helper or one error renders at a time. <Field data-invalid>tints its label like the control's ownaria-invalid.FieldSet+FieldLegendgroup related controls. Other slots areFieldContent,FieldTitle,FieldSeparatorandFieldGroup.FieldErroralso accepts anerrorsarray of objects with an optionalmessage.
Related
Labels and helper text use the Typography caption role; invalid states use the semantic ink in Colors.