Today, users interact with forms on all kinds of devices. Because user input and selection may be with a finger or a mouse, form fields have been enlarged to the minimum touch target size of 44px. Futhermore, subtle cues have become standard in usability to help users during the process of completing forms. Focused or selected fields are shown with a teal stroke.
Review the following guidelines for optimal form design and development.
Use checkboxes when multiple options can be selected.
Default
Robust
Hover
Active/Selected
Disabled
Error - Default
Error - Hover
Error - Active/Selected
Group - Error
Group - Disabled
Use radio buttons when only one selection can be made. If there are more than 7 options, use a select menu instead.
Default
Robust
Hover
Active/Selected
Disabled
Error - Default
Error - Hover
Error - Active/Selected
Group - Error
Group - Disabled
Form labels are always shown above the form field and left justified. Never place the label to the left of the field because it is not immediately apparent to a user what input is required.
Default
Robust
Filled
With Placeholder
Disabled
Hover
Active
With Info
With Description
Error
Date Picker
Search
Clear Search
Default
Robust
Filled
With Placeholder
Disabled
Hover
Active
With Info
With Description
Error
Default
Robust
Active Single Select
Active Multi-Select
Hover
With Description
Disabled
Error
With Info
Active
Active - Item Hover
Active - Item Click
Multi-Select - Active
Active - Item Hover
Active - Item Click/Selected
For all inputs, the focus state is derived from the browser. We also change the input border color as outlined below.
Error messages appear after the label and before the input. A light red background is used to bring attention to the message, while a red border highlights the input.
See Alerts page Error messaging specifications at the top of the page.
Descriptions are used to provide additional instructions the user needs to complete the task. They should only be used when information is needed in order to prevent an error. Use Descriptions sparingly to prevent information overload within a form. Descriptions have a 100-character maximum.
The Description is placed before the input to provide necessary information before the user engages with the input, both for sighted users and those using screen readers. In order for screen readers to verbalize this information, the subordinate content must be nested within the label.
Note: Do not use placeholder text to provide information the user needs in order to execute the task.
Inline validation shows the user in real time if an error has occurred while filling out a form. It may be an input error, such as using an incorrect character, or it could be that the field is required and was tabbed through. Using inline validation is preferred.
With Mistake
Corrected Mistake
In post-validation, the form is checked for errors after the user selects to save or submit. The page reloads, and the same visual cues are used as with inline validation. In addition, an error alert is used. Inline validation and post-validation can be combined to show errors inline and then messaging after validation.
Corrected Mistake
Contact Information
It’s important to differentiate between required and optional fields. When using forms that contain mostly required fields, we recommend indicating which inputs are optional, rather than marking the required fields. Do not use an asterisk in the label to indicate mandatory fields—instead, write out “Optional” or “Required.”
To maintain consistency and set expectations for the user, select one approach to use within a single application.
Example