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… | Use | Stays until | Component |
|---|---|---|---|
| Confirms something just worked (“Saved”) | Toast | It times out or is closed | eds-toast |
| Explains a problem the user must fix, or a lasting state (“Your session expires in 5 minutes”) | Alert, next to what it is about | The problem is gone or it is dismissed | eds-alert |
| Needs a decision before anything else can happen (“Delete this catalogue?”) | Modal | The user chooses | eds-modal |
Ask two questions:
- Must the user do something? No: toast. Yes, but not right now: alert. Yes, before continuing: modal.
- 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
| Situation | Use |
|---|---|
| “File uploaded” | Toast, success |
| “Connection lost, retrying…” | Toast, warning |
| “3 fields need attention” after submitting a form | Alert, 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 modal | Toast, success |
Match the intent to the severity
| Intent | Meaning |
|---|---|
success | Done, nothing else needed |
info | Worth knowing, no action needed |
warning | Could go wrong; check before continuing |
error | Did not work; say what to do next |
default / brand | Neutral 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-managerand 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-alerthasrole="alert";errorandwarningare announced immediately, the others politely.eds-toastis announced immediately; thebannervariant politely.eds-modalmoves 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
| Do | Don’t |
|---|---|
| Put errors that need action in an alert next to the problem | Report form errors only in a toast |
| Confirm finished actions with a short toast | Open a modal to say “Saved” |
| Use a modal only when the user must decide now | Use modals for information or marketing |
| Name the action on modal buttons | Use “OK” / “Yes” / “No” |