Field
Pair a form control with its label, hint, and validation message using the field pattern.
Use one field for each form control. Use a <fieldset> with a <legend> to name a group of related fields.
Connect each label with for and each hint or error with aria-describedby. Set aria-invalid="true" when validation fails. There is no separate Field initializer.
Examples
Input and hint
Breakpoints
Mobile
320pxMobile Lg
480pxTablet
640pxDesktop
1024pxWe will send updates to this address.
HTML
Error message
Breakpoints
Mobile
320pxMobile Lg
480pxTablet
640pxDesktop
1024pxEnter the address where we can reach you.
Enter a valid email address.
HTML
Select
Breakpoints
Mobile
320pxMobile Lg
480pxTablet
640pxDesktop
1024pxChoose how you would like a reply.
HTML
Textarea
Breakpoints
Mobile
320pxMobile Lg
480pxTablet
640pxDesktop
1024pxInclude any details that will help us respond.
HTML
Fieldset
Use a fieldset and legend for a group of related controls. Keep each control’s label associated with its own input.
Breakpoints
Mobile
320pxMobile Lg
480pxTablet
640pxDesktop
1024pxHTML