This environment is not optimized for viewing on small or mobile devices. Please view on a larger browser for the best experience.
If you have any questions, please contact us.
Our form elements are designed to help users complete forms efficiently and successfully. Review both element design and implementation guidelines to understand how to support the form experience through both development and front-end styling.
Review the following guidelines for optimal form design and development.
There are many considerations that go into a well-designed form experience, beyond the styling of the elements. We’ve outlined some key areas to focus on to build a user-friendly form experience.
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 the field is required and was tabbed through. Using inline validation is preferred.
Best Practice
Errors should not appear before the user has finished completing the input.
Error messages should be removed dynamically once the user has corrected their mistake. Messaging should live-update on a keystroke level.
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.
pre-Submission
Post-Submission
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 for specifications on Error banners at the top of the page.
For all inputs, the focus state is derived from the browser. We also change the input border color as outlined below.
Descriptions are used to provide additional instructions the user needs to complete the task. They should only be used when information is needed to prevent an error. Use Descriptions sparingly to prevent information overload within a form and keep them to 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. 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 to execute the task.
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.