Brand Guide

Components

Errors

The control's border turns red and a message under it says what to do next.

The rule

One colour, one place, one way of writing.

  • One colour. The control's border turns destructive and so does the message. The label stays foreground.
  • One place. The message sits under the control, 8px below it, and takes the place of any helper text while it shows.
  • One way of writing. The message says what to do next, in one sentence.

Focus never hides an error: a focused control keeps its red border, and a 1px red inset doubles it. A switch never errors, and a slider only errors when it is required and still not set.

Field

Type an amount and the helper text comes back in the message's place. Tab into the empty field to see the error while focused.

Group

Every option takes the red border, so the group reads as one error. Radios, checkboxes and choice cards do the same.
Where do you want to work?

Single checkbox

The message lines up with the label, not the box.

Form-level

Only for problems the person can't fix in a field, such as a server or network failure. The message sits above the actions, and field errors are never repeated there. Press Send application to see it.

Writing the message

One sentence that says what to do, ending in a full stop. It starts with one of four verbs: Enter, Choose, Upload or Accept. Never "Please", "required", "invalid" or "This field".

Situation Pattern Example
Typed field left empty Enter your {thing}. Enter your work email.
Wrong format Enter a {thing} like {example}. Enter an email address like name@company.com.
Nothing chosen Choose {a thing}. Choose a notice period.
Group with nothing chosen Choose at least one option. Choose at least one option.
Out of range Choose {a thing} {rule}. Choose an end date after the start date.
File rejected Upload {a thing} {rule}. Upload a PDF or DOCX under 10 MB.
Consent not given Accept {the thing} to continue. Accept the terms to continue.
Server or network We couldn't {action}. Try again, or {contact}. We couldn't send your answers. Try again, or email hello@meetdex.ai.

In code

  • A single control goes in a Field with invalid. FieldControl passes aria-invalid and the message's id to the control, and FieldMessage shows its error in place of its description.
  • A group goes in a FieldSet with invalid, which turns every option inside it red. Setting aria-invalid on the group itself does the same.
  • FieldMessage gives the error role="alert". A message written by hand, as under a single checkbox, needs the role and an aria-describedby from the control.
  • On submit, move focus to the first field with an error.
  • Keep the form's main button active, and show the errors when it is pressed.