Components / Base / Toast

B7 · Base

Toast

An archive action with an undo notice that stays for 5 seconds.

When to use

  • A destructive action can be undone.
  • The notice should leave on its own.

When not to use

  • The action cannot be undone. Ask in a dialog first.
  • The notice must block the page.

Usage

<div class="c-toast" role="status">
  <span>Archived DOC-1042 in this example.</span>
  <button type="button">Undo</button>
</div>

Variants

The preview shows the form used in the gallery.

Props

NameTypeDefaultDescription
role=statusattribute—Announces the archive.
data-undobutton—Restores the row and hides the notice.
timeout5 s5 sHides the notice. The row stays archived if undo was not used.

Keyboard

KeyAction
EnterOn Archive, shows the notice.
EnterOn Undo, restores the row.

Accessibility

Motion

Pattern origin

Base feedback. Undo stays for 5 seconds.

Related

DialogUpdate notice