GC Design system Components Installation Contact us Get involved GC Design System Components

Error message
<gcds-error-message>

Also called: error, inline error.

An error message is a description of a problem blocking a user goal.

Error message component preview

Error message.

Error message anatomy

  1. The error message cites the problem in context and includes a call to action to address it.
Error message anatomy represented by a warning icon (white exclamation mark within a red triangle) next to the text "Error message".

Error message applied to a form component

All GC Design System components come with default error handling for required form components.

For your own component instances, add the error message component, and include the following:

  1. The required marker shows a response area, a field or selection, needs to be completed. An incomplete response or omission will prompt an error message.
  2. The hint text gives brief, specific instructions about the constraints of the response. It can give an example of an accepted response.
  3. The error message cites the problem in context and includes a call to action to address it.
  4. The response area takes on the appearance of the response format and error message state of the component it’s attached to. For an input or text area, the box will be highlighted. For radios or checkboxes, the options will be highlighted.
Error message taxonomy represented by four elements: label or legend (required), hint / example message, warning icon next to the text "Error message" and a response area (red rectangle).

Design and accessibility for error messages

When you interrupt the flow of a person's action in your product, make the error and recovery obvious to get them back on task and they can regain momentum.

Identify and define the error

Get the person back on track with a call to action

Write a message that's scanable

Tip: Think about whether the message could be interpreted another way.

Use a human tone

Tip: To adopt a more human tone, think about explaining the error aloud to someone. How does it sound when you speak it in conversation?

Help us improve

Have questions? Something you'd change or you'd like to see? Share your feedback with us to help improve GC Design System.

Give feedback
2024-08-07