Notifications

The problem: the app needs to tell the user something: an action worked, something failed, something needs a decision. Too loud and it interrupts; too quiet and it is missed.

The solution: match the message to how much it matters and whether the user has to act. Three components cover it: an inline alert, a short toast, and a blocking modal.

Choose by what the user must do

The message…UseStays untilComponent
Confirms something just worked (“Saved”)ToastIt times out or is closededs-toast
Explains a problem the user must fix, or a lasting state (“Your session expires in 5 minutes”)Alert, next to what it is aboutThe problem is gone or it is dismissededs-alert
Needs a decision before anything else can happen (“Delete this catalogue?”)ModalThe user chooseseds-modal

Ask two questions:

  1. Must the user do something? No: toast. Yes, but not right now: alert. Yes, before continuing: modal.
  2. Would it be a problem if they missed it? Then it is not a toast. Toasts disappear, and screen-magnifier users may never see them.

Examples

SituationUse
“File uploaded”Toast, success
“Connection lost, retrying…”Toast, warning
“3 fields need attention” after submitting a formAlert, error, above the form
“This dataset is read-only”Alert, info, at the top of the page
“Delete this item? This cannot be undone.”Modal with Cancel / Delete
“Item deleted” after that modalToast, success

Match the intent to the severity

IntentMeaning
successDone, nothing else needed
infoWorth knowing, no action needed
warningCould go wrong; check before continuing
errorDid not work; say what to do next
default / brandNeutral or branded messages (announcements), not statuses

Don’t use error for things the user did not do wrong, and don’t use colour alone: the icon and the words must carry the meaning too.

Write the message

  • Say what happened, then what to do. “Couldn’t save your changes. Check your connection and try again.” Not “Error 500”.
  • Lead with the important word. “Saved”, “Upload failed”, “Session expires soon”.
  • Keep toasts under about 90 characters. One sentence, no links the user must click in time.
  • Modal titles are questions or actions: “Delete this catalogue?”, with buttons that repeat the verb (“Delete”, not “OK”).
  • No blame, no jargon. “That email address is already registered”, not “Invalid input”.

Put it in the right place

  • Alerts go next to what they are about: above the form, at the top of the section, or at the top of the page for page-wide states.
  • Toasts appear in one place for the whole app. Render one eds-toast-manager and send every toast through it, so they stack instead of overlapping.
  • Modals open over the page; the action that opened them gets focus back when they close.

Confirm a destructive action

  • Say exactly what will be lost in the body.
  • Secondary action first, primary last (on the right). The primary button repeats the verb of the title.
  • After it is done, confirm with a toast (“Catalogue deleted”).
  • For actions that can be undone, skip the modal: do it, and offer Undo in a toast or alert.

Accessibility

The components announce themselves, so don’t add extra live regions:

  • eds-alert has role="alert"; error and warning are announced immediately, the others politely.
  • eds-toast is announced immediately; the banner variant politely.
  • eds-modal moves focus into the dialog and back to the trigger when it closes.

Show at most one or two toasts at a time, and give anything with a time limit a way to stay (duration off, or an alert instead).

Do and don’t

DoDon’t
Put errors that need action in an alert next to the problemReport form errors only in a toast
Confirm finished actions with a short toastOpen a modal to say “Saved”
Use a modal only when the user must decide nowUse modals for information or marketing
Name the action on modal buttonsUse “OK” / “Yes” / “No”