Field
Label, control, and description layout.
Default
FieldLabel is wired to the control automatically, with an 8px gap.
Description
FieldDescription explains the value and is announced with the control.
The agent forwards calls here when a caller asks for a person.
Optional
Mark optional fields in the label rather than marking required ones.
Error
Leave the field to validate. The control shakes once and FieldError eases open; fix the address to clear it.
Enter a valid email address.
Disabled
disabled on Field disables the control and dims the label.
Release the number from its agent to change it.
Best practices
When to use
- Use to compose one label, control, description, and validation message as a unit.
- Use Fieldset when several related fields share one group label, and Label alone when a control needs no description or error.
Behavior
- Validate on blur or submit. The control shakes when it first becomes invalid, and FieldError eases open over 280ms and stays mounted for the exit.
- Set disabled on Field to disable the control and dim FieldLabel together.
- Mark optional fields with a regular-weight “Optional” hint in FieldLabel rather than marking every required field.
Content
- Write FieldDescription as one sentence about what the value does, such as “The agent forwards calls here when a caller asks for a person.”
- Write FieldError as the fix, such as “Enter a valid email address.”, not “Invalid input”.
Accessibility
- FieldLabel, FieldDescription, and FieldError are associated with Base UI controls automatically. For controls that are not Field-aware, such as Textarea, wire htmlFor and aria-describedby yourself.