Skip to main content

Components

ErrorSummary

ErrorSummary is a summary of errors. It provides the user with an overview of errors or issues that need to be addressed on a page or step in order to proceed.

Use ErrorSummary when

  • you need to present a clear overview of the errors that must be corrected before a form can be submitted
  • a form contains many fields, making it difficult for users to understand where the errors are located

Avoid ErrorSummary when

  • the feedback does not prevent submission, such as warnings or recommendations
  • you need to display system-level messages; use Alert instead

Example

Use in forms

In the example below, each link in the ErrorSummary lets you navigate directly to the field containing an error.

Guidelines

ErrorSummary is used to display a summary when there are errors or omissions in something the user has done. A summary may include one or several errors.
ErrorSummary should contain all error messages present on the page, so users can navigate directly to them by clicking the links in the summary.

Placement

We recommend placing ErrorSummary just above the Next/Submit button. This helps users understand the connection between the errors and why they cannot proceed.

In some cases, it may be better to show the summary at the top of the page.
You can read more about this in the article on error messages.

Visibility

The summary should not be visible before the user has taken an action that triggers an error. It should become visible only after the user performs an action that results in errors.

  • If validation happens continuously (for example using onBlur on each field), wait to show ErrorSummary until the user attempts to submit the form.
  • It is important that the component receives focus when it appears, so the user notices that there are errors or missing information.
  • Error messages must link directly to the relevant field.
  • If the error applies to several fields, for example when two fields are validated together, link to the first instance of the error.

Text

Ensure that the heading “To continue, you must correct the following errors” is used in ErrorSummary. The error messages in the summary should be phrased exactly the same as the error messages displayed at the relevant fields.

Edit this page on github.com (opens in a new tab)