FBK-005 Give a toast at most one action, keep it until it is used, and offer that action elsewhere too
- Level
- Rule
- Verdict
- Unanimous (2 of 2)
- Area
- Feedback
- Status
- decided, version 1.0.2
Rule
A toast or snackbar holds at most one action button besides its close control. While it holds one, it stays until the person uses it, closes it or leaves the view, or a newer message makes it moot. Its action can also be done from a place that lasts.
Examples
Live examples built with Justified's components. Try them with the mouse, the keyboard or a screen reader.
Do: One Undo that waits, and a lasting way back
Contacts
- Anna Brooks
Merged with A. Brooks, 14:02
Anna Brooks and A. Brooks were merged
Don't: Three actions and a timer
Contacts
- Anna Brooks
Anna Brooks and A. Brooks were merged
Why
A toast is small and sits away from where the person is working. One button in it is quick to read and hard to miss; two or three turn a passing note into a small dialog that nobody asked for. A button is also only useful while it is there. If the toast closes on a timer, someone who reads slowly, uses a screen reader, magnifies the screen or moves with a switch can lose the chance before they reach it. And a toast can still be gone for other reasons: the person closes it by mistake or leaves the view. So what its button does must not depend on the toast alone. As the W3C reads WCAG 2.2, 2.2.1 Timing Adjustable, a message that vanishes on a timer while it holds a button sets a time limit, unless the same thing can be done another way. Keeping the toast, offering a lasting route or giving a setting such as "keep messages until I close them" each meets that, so WCAG requires none of them on its own. Asking for the first two together is the judges' guidance and our choice. A lasting route also helps 2.1.1 Keyboard when a toast is awkward to reach with Tab, though the toast's own button must still work from the keyboard. How the toast's text is announced, under 4.1.3 Status Messages, is covered by FBK-004.
Do
- The person merges two contacts. A toast says "Anna Brooks and A. Brooks were merged" with Undo and a close button. It stays until they use Undo, close it or leave the view. The contact's History can split them again later.
- An image fails to upload. A toast offers Try again, and the upload area keeps the lasting notice FBK-002 asks for, with its own Try again.
- The person moves a meeting to Thursday. The toast "Meeting moved to Thursday" offers Undo. Shortly after, they move the same meeting to Friday. A new toast "Meeting moved to Friday" with Undo replaces the first one, which no longer applies.
- Put the facts in the message and the single next step in the button. If the text needs a link to a help page, leave it in the text; this rule counts buttons only.
- Keep Undo in the toast while it still applies, even when other toasts arrive. They wait, and never remove or cover it.
- Show the change in the view as well, as FBK-003 says, and follow DST-001a for how Undo works and where the lasting way back lives.
- When the server refuses a delete that offered Undo, the item comes back and the toast with Undo is removed or replaced, since nothing is left to undo. The failure shows where FBK-002 says (STA-005a).
Don't
- Put Undo, View and Share as three buttons in one toast.
- Let a toast with Undo close by itself after six seconds while the person is still in the view.
- Let an unrelated toast such as "Draft saved" push off a toast whose Undo still applies.
- Offer Try again for a failed sync only in a toast, with no way to start the sync again once the toast is gone.
- Make a toast the only place to open the item a background job just created, with no list where it can be found later.
Exceptions
- Toasts without an action. A toast that only reports something is not covered here. FBK-003 says it may never be the only sign of a result, and FBK-002 covers where failures are shown.
- More than one choice. If the person has to pick between two or more steps, the message is not a toast. Use an inline notice on the page or a dialog.
- Links in the text. A link inside the message text is not an action button in this rule, and the rule neither counts nor forbids it.
- Focus. This rule does not say where focus goes when the toast appears or closes. FBK-004 leaves that open for messages with an action, and DST-001a decides it only for Undo. A toast that would hide the focused element is covered by KBD-002.
Verdict
Unanimous (2 of 2). Only the judges decide; the expert witnesses are shown but do not vote. How verdicts work
| Source | Role | Stance | Page |
|---|---|---|---|
| WCAG 2.2 | Law | Supports | 2.2.1 Timing Adjustable |
| WCAG 2.2 | Law | Supports | 2.1.1 Keyboard |
| WCAG 2.2 | Law | Supports | 4.1.3 Status Messages |
| Material Design | Judge | Supports | Snackbar: guidelines Snackbar: accessibility |
| Apple Human Interface Guidelines | Judge | No position | |
| Carbon Design System | Judge | Supports | Notification: usage Notifications Notification: accessibility |
| GOV.UK Design System | Expert witness | No position | |
| Nielsen Norman Group | Expert witness | No position |
Each stance links to the page it rests on, read on the date in the source register. This page never repeats what a source says; read the source itself.
History
- Version 1.0.2, : A delete with Undo that the server refuses withdraws the Undo, as STA-005a and DST-001a say.
- Version 1.0.1, : Examples in English.
- Version 1.0.0, : First version.
Last checked against the other rules for conflicts on .
More in Feedback: 4 rules and 0 guidelines · All rules
Justified is an independent project. It is not affiliated with, sponsored or endorsed by the organisations whose guidance it cites. Read the full statement.
Apple is a trademark of Apple Inc., registered in the U.S. and other countries and regions.