Skip to main content
  1. Docs
  2. Components
  3. Overlays

Toast

A brief word that something happened, at the bottom end. One action at most, such as Undo.

Import
@qeetrix/react
Status
StableSince 0.0.2
Renders
<div role="region">Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

When to use

Use it for
  • Confirming something done: sent, saved, removed.
  • Undo, for a moment.
  • Work finishing in the background.
Not for
  • A problem with the page that must be fixedAlert
  • A decisionDialog
  • Errors on a formForm

02

Anatomy

  1. 1toast-icon<svg>The tone's icon, 16px, on the title's line.
  2. 2toast-title<h2>What happened, in a few words.
  3. 3toast-description<p>One more line, if it helps.
  4. 4toast-action<button>One action at most: Undo.
  5. 5close<button>Close, neutral.

03

Do and don't

What happened, in a few words
DoThe fact, then one line if it helps.
Don'tA paragraph that's gone in five seconds.
Not for what must be fixed
DoA failure the page can't continue past belongs in the page: an Alert.
Don'tA toast for a broken form, gone before it's read.

04

Content

  • Titles in the past tense: "Invoice sent", "Priya Sharma removed".
  • One action, a verb: "Undo", "Retry".
  • Danger stays until closed: say what failed and what to do.
Next — ToastAPI