On this page
Overview
Show code, SaveChanges.tsx
Variants
Tones
- Neutral
Routine feedback, such as Files archived. The default.
- Success
An action that worked, such as Invitation sent.
- Info
Something worth noticing that needs no action.
- Danger
An action that failed.
Still picture, not live
Show code, Tones.tsx
Placements
Past a limit, older notifications wait behind a count, and danger notifications always show.
- Bottom end
Most applications, at the bottom corner at the end of the line. The default.
- Top center
An application whose bottom corner is taken.
Show code, TopCenter.tsx
Anatomy
Notification
Tone icon
Message
Action
Dismiss button
Show code, ToastAnatomy.tsx
Behaviour
Duration
Its timer pauses while the pointer rests on it or it has focus.
Over a modal
While a modal, such as a Dialog or a Sheet, is open, notifications wait until it closes, so none covers its actions. Each then shows, and is announced, for its full duration.
Undo
A notification with an action stays until its action has run or people dismiss it.
Show code, UndoArchive.tsx
Retry
A danger notification stays until it is dismissed, and is announced at once.
Show code, RetryAfterError.tsx
Background work
A notification can stay until people dismiss it.
Show code, ExportReady.tsx
Rules
Keep what a notification offers reachable in the page too: it closes by itself.
Use it when
- Feedback after an action, such as Changes saved
- An undo right after an action that took effect at once
- An action that failed and can be tried again
- Work that finished in the background, such as an export
Show code, OneForMany.tsx
Show code, OnePerItem.tsx
Content
Label an action with a short verb, such as Undo or Try again, and give a notification one action at most.
Accessibility
| Key | Action |
|---|---|
| F6 | Moves focus to the notifications, and pauses them. |
| Tab, Shift+Tab | Moves through the notifications and their buttons, then back to the page. |
| Esc | Dismisses the focused notification. |
| Enter, Space | Runs the action, or dismisses with the dismiss button. |