Toast / Snackbar
A short message that pops up, says what just happened, and disappears on its own. Learn the Android, iOS and web versions, how long they should stay, the Undo pattern, and the timing and stacking bugs testers find.
You archive an email and a dark bar slides up from the bottom: “Conversation archived · Undo”. A few seconds later it’s gone. You didn’t have to tap anything, and you could keep working while it was there. That little bar is a toastToastA short, temporary message that appears briefly and disappears on its own, like 'Message sent'.Open in glossary →, called a snackbar in Material Design.
Toasts are small, but testers love them. They disappear on a timer, they appear on top of other things, they promise that something worked, and the Undo button has to really undo. Each of those is a place for bugs.
What is a toast?
A toast is a brief, non-blocking message that appears on top of the screen, confirms what just happened, and disappears automatically. Unlike a modalModalA window that appears on top of the page and blocks the content behind it until it is closed.Open in glossary →, it doesn’t stop the user. They can ignore it and carry on.
You’ll usually see one used to:
- Confirm an action: Link copied, Added to bag, Settings saved.
- Offer a quick way back: Conversation archived · Undo, Item removed · Undo.
- Report a small, temporary problem with a fix: Couldn’t send. Retry.
Anatomy
- 1
Container
A small dark (or light) surface with rounded corners. It floats above the content but does not block it.
- 2
Message
One short sentence about what just happened: "Conversation archived". Max two lines.
- 3
Action (optional)
One short text button, usually Undo, Retry or View. Never "OK" or "Dismiss".
- 4
Close icon (optional)
Lets the user dismiss it early. Common on web toasts and long snackbars.
- 5
Placement
Above the bottom navigation and the floating button, never on top of them. Web: a corner or top/bottom center.
- 6
Timer (invisible)
Hides it automatically after a few seconds. Longer when there is an action.
How it differs from similar components
| Component | Blocks the user? | Disappears by itself? | Typical use |
|---|---|---|---|
| Toast / snackbar | No | Yes, after a few seconds | Feedback on an action, optional Undo |
| Banner (in-page) | No | No, until fixed or dismissed | Ongoing status: “You’re offline”, “Card expires soon” |
| Inline message | No | No | Form errors, next to the field that has the problem |
| Dialog / alert | Yes | No | Decisions and errors the user must deal with |
| Push notificationPush notificationA message an app sends to the device that appears even when the app is closed.Open in glossary → | No | Goes to the notification center | Messages from outside the app, even when it’s closed |
Dev note
On Android, a Toast is a specific system component (plain text, no buttons) and a Snackbar is the Material component with an optional action. iOS has no native toast at all: apps use custom banners or HUDs. On the web, people say toast, notification, flash message or alert. In a bug report, describe what you saw (“the snackbar at the bottom”).
Designs & variants
Tap the buttons inside each screen. Watch how long each message stays, where it appears, and what you can do with it.
Share recipe
Toast
AndroidThe system Toast: a small pill near the bottom with plain text. No buttons, can't be tapped or swiped away. Android 12+ shows the app icon.
2 s (short) or 3.5 s (long)
Inbox
- Lisbon trip itinerary
- Your order has shipped
- Team lunch on Friday?
- Invoice #1042
- Weekly running summary
Snackbar with action
Android · Material 3One action (here Undo). Appears above the bottom navigation and pushes the floating button up. Only one at a time: a new one replaces the old one.
4–10 s, longer with an action
Midnight Drive
Lumen · Album
HUD
iOSiOS has no native toast API. Some Apple apps have used a centered square like this for quick confirmations; third-party apps copy it or build their own.
About 1.5–2 s
Trail running shoes
€119.00 · Size 42
In-app banner
iOSA custom banner that slides down from the top, styled like a notification. Can hold one action (View). Hover or focus pauses it here.
About 4 s
Settings
Toast stack
WebWeb apps usually stack toasts in a corner. Limit the stack (here 3), pause the timer on hover or focus, and give every toast a close button.
5 s for success, errors stay
Chat with Ana
Two-line snackbar with close
Android · WebLonger messages wrap to two lines and the action moves below the text. A snackbar that waits for the user needs a close icon.
Stays until dismissed or Retry
How long should it stay?
There’s no single number, but these are good rules to test against:
| Situation | Typical duration |
|---|---|
| Android system Toast | 2 s (LENGTH_SHORT) or 3.5 s (LENGTH_LONG), fixed by the system |
| Short confirmation, no action | About 4–6 s |
| With an action (Undo, Retry) | Longer, around 6–10 s, or until dismissed. Jetpack Compose’s Material 3 snackbar stays until dismissed by default when it has an action |
| Material snackbar presets | Material’s guidance is roughly 4–10 s. In Compose, SnackbarDuration.Short is 4 s and Long 10 s; the older View-based Snackbar uses much shorter presets (about 1.5 s and 2.75 s), so check which one the app uses |
| Error that needs the user | Don’t auto-hide at all, or don’t use a toast |
The longer and more important the message, the longer it should stay. On the web, the timer should also pause while the pointer or keyboard focus is on the toast, so it doesn’t vanish under the cursor.
The Undo pattern
Undo is what makes toasts powerful: instead of asking “Are you sure?” in a dialog, the app does the action immediately and offers to reverse it. That’s faster for everyone, but it’s only safe if Undo really works. Testers check:
- Undo restores exactly the right item, in the same place, with the same state (read/unread, starred, labels).
- Undo works after several actions in a row: archive two emails, then undo the last one.
- The server agrees. After Undo, a refresh or another device still shows the item.
- Undo is reachable in time with large text, a screen reader or a slow hand.
- Nothing happens twice. Tapping Undo twice doesn’t restore two copies.
When to use it
A toast is a good choice when:
- The message is short (one line, two at most) and confirms something the user just did.
- The user doesn’t need to do anything. If they miss it, nothing bad happens.
- There is at most one simple action, like Undo or Retry.
- The action was reversible or already succeeded.
Good and bad uses
Confirm a reversible action
Short, about something the user just did, with a way back.
Errors the user must act on
If they miss it, they think they ordered. A failed payment needs a dialog or an inline message that stays until the user fixes it.
Form errors next to the field
Enter a valid email, like name@example.com
The error stays visible while the user fixes it, right where the problem is.
Validation errors in a toast
Invalid input
Please check the form.
Which field? By the time the user scrolls to look, the toast is gone.
One message for a batch
One summary, one Undo.
A pile of toasts
Three identical bars cover the content, and it’s unclear what each Undo would restore.
Common bugs
| # | Bug | What you see | Typical severity |
|---|---|---|---|
| 1 | Undo doesn’t undo | Item doesn’t come back, the wrong item comes back, or it reappears after refresh | High |
| 2 | Too fast | Disappears before you can read it or reach Undo | Medium |
| 3 | Success after failure | “Saved” even though the request failed (500 or offline in the network log) | High |
| 4 | Endless stacking | Many toasts pile up and cover the screen | Medium |
| 5 | Covers important UI | On top of the bottom navigation, the FAB, “Checkout” or the keyboard | Medium |
| 6 | Truncated text | Message or action cut off in other languages or with large text | Medium |
| 7 | Timer never pauses (web) | The toast disappears while your mouse is on its button | Low–Medium |
| 8 | Screen reader silence | VoiceOver / TalkBack doesn’t announce it | High (for affected users) |
| 9 | Shows on the wrong screen | You navigate away and the toast follows, or appears after you return | Low |
| 10 | Can’t be dismissed | No close button on a long or persistent toast; it blocks content | Low–Medium |
Try it: toast timing lab
Set the duration to 2 seconds and try to press Undo. Turn off pause-on-hover and hover a toast. Pick Unlimited stacking and press Add 5 quickly. Turn off the live region and see what a screen reader user would get.
🧪 Toast timing lab
Change the settings, then add items to the wishlist. Try to press Undo in time, hover a toast, and spam the button.
Trail running shoes
€119.00
Problems with these settings
Sensible settings. Now set the duration to 2 s and try to press Undo.
Screen reader would say
- Add something to the wishlist…
Find the bug
This mail app archives emails with a snackbar and Undo. It has six bugs. Explore it like a tester:
- Archive one email, then two in a row, and use Undo.
- Watch how long the snackbar stays and where it appears.
- Turn on Poor connection, archive, then refresh (the button next to the search bar).
- Turn on Large text.
🐞 Bug hunt: Mail inbox
This demo has 6 hidden bugs. Explore it like a tester, then check your findings.
Primary
- TTAP Air PortugalYour Lisbon trip itinerary
- PPeak OutdoorYour order has shipped
- AAna SilvaTeam lunch on Friday?
- CCityBankYour October statement
- RRunClubWeekly running summary
- FFoodly20% off sushi tonight
Device settings
Network log
- Archive an email to see API requests…
- 1
Hint: Archive one email, wait, archive another, then press Undo.
- 2
Hint: Count how long the snackbar stays.
- 3
Hint: Archive three emails quickly.
- 4
Hint: Look at what is under the snackbar.
- 5
Hint: Turn on Poor connection, archive an email, check the network log, then refresh.
- 6
Hint: Turn on Large text and archive an email.
How to test it
Checklist
Toast / snackbar test checklist
0 of 12 checked
Example test cases
TC-TST-001Archive shows a snackbar with Undopositivehigh
Steps
- Open the inbox
- Tap the archive icon on "Team lunch on Friday?"
Expected result
The email disappears and a snackbar "Conversation archived" with "Undo" appears above the bottom navigation for at least 4 s.
TC-TST-002Undo restores the correct emailpositivehigh
Steps
- Archive "Your order has shipped"
- Wait 5 s
- Archive "Team lunch on Friday?"
- Tap Undo
Expected result
"Team lunch on Friday?" is back in its original position. "Your order has shipped" stays archived. After refresh, the result is the same.
TC-TST-003Failed request shows an error, not successnegativehigh
Preconditions
- Server returns 500 for archive, or device is offline
Steps
- Archive any email
- Wait for the request to finish
Expected result
An error such as "Couldn't archive. Retry" is shown and the email stays in (or returns to) the inbox.
TC-TST-004Snackbars replace each otheredgemedium
Steps
- Archive three emails within 2 seconds
Expected result
Only one snackbar is visible at any time. Undo on it restores the last archived email.
TC-TST-005Snackbar does not cover navigation or the FABpositivemedium
Steps
- Archive an email
- While the snackbar is visible, tap each bottom navigation item
Expected result
The snackbar sits above the navigation bar, the Compose button moves up, and all navigation items work.
TC-TST-006Message is readable at the largest text sizeedgemedium
Preconditions
- System font size set to maximum
- App language set to German
Steps
- Archive an email
Expected result
The full message is readable (wraps to two lines if needed) and the Undo action is fully visible.
TC-TST-007Web toast pauses on hover and focuspositivelow
Steps
- Trigger a toast
- Move the mouse over it and wait 15 s
- Move the mouse away
- Trigger another and Tab to its Undo button, wait 15 s
Expected result
The toast stays while hovered or focused and starts its timer again afterwards.
TC-TST-008Screen reader announces the toastpositivemedium
Preconditions
- TalkBack / VoiceOver / NVDA is on
Steps
- Archive an email (or trigger the toast on web)
Expected result
The screen reader reads "Conversation archived" (and the action) without moving focus away from where the user was.
Tip: click a test case to expand it.
Accessibility
- Announce it. Screen readers don’t notice text that just appears (WCAGWCAGThe Web Content Accessibility Guidelines, the main international standard for accessibility.Open in glossary → 4.1.3 Status Messages, Level AA). Native Android Snackbars and Toasts are announced by TalkBack; custom iOS banners need an announcement.
Dev note
On the web, put toasts inside a container withrole="status"(oraria-live="polite") that already exists in the page before the message is added. Userole="alert"only for urgent errors. On iOS:UIAccessibility.post(notification: .announcement, ...). - Don’t steal focus. A toast should be announced, not focused: moving focus would interrupt what the user was doing.
- Give enough time. WCAG 2.2.1 (Timing Adjustable) asks that users can turn off, adjust or extend time limits. For toasts that means a long enough duration, pausing on hover and focus, and never putting the only copy of important information in one. Android also has a system setting (“Time to take action”) that apps should respect.
- Make the action reachable. Keyboard users must be able to reach Undo before it disappears. Some apps offer an alternative, like a keyboard shortcut or an Undo item in a menu.
- Contrast. Message text needs 4.5:1 against the toast background, and the action button color too. Check in light and dark modeDark modeA display setting that uses light text on dark backgrounds.Open in glossary →.
- Don’t rely on color alone for success vs error: add an icon and clear words.
- Large text. At the biggest Dynamic TypeDynamic TypeThe phone setting that lets users make text bigger or smaller across apps.Open in glossary → or font scale, text must wrap, not clip, and the action must stay visible.
Mobile vs web
- No native toast. Apps build their own: top banners that look like notifications, centered HUDs, or Material-style bars from a library. Quality varies a lot.
- Check placement against the notch / Dynamic Island, the home indicator and the tab bar.
- Custom components often forget VoiceOver announcements and Dynamic Type.
- Swipe-to-dismiss (usually up for top banners) should work and must not trigger the system notification center.
- Toast: system pill, text only, 2 s or 3.5 s, no actions. Since Android 11, apps in the background can’t show custom-view toasts, and Android 12+ limits toast text to two lines and shows the app icon.
- Snackbar: Material component with one optional action. One at a time, above the bottom navigation, pushes the FAB up.
- Test with TalkBack, maximum font size, gesture navigation vs 3-button navigation, and with the keyboard open.
- Rotate while a snackbar is visible: it should not duplicate or reappear.
- Usually from a library (or hand-made). Common positions: top right, top center, bottom center. Check the position on small screens too.
- Check the live region in DevToolsDevToolsDeveloper tools built into browsers for inspecting pages, network traffic and errors.Open in glossary → (Elements panel:
role="status"/aria-live), and test with a screen reader. - Check pause on hover/focus, the close button, and stacking limits.
- Check that a toast doesn’t survive a page navigation it shouldn’t, and that “Saved” matches the real APIAPIThe way different software parts talk to each other, like an app asking a server for data.Open in glossary → response in the Network tab.
Check your understanding
Quick quiz
0/5 answered · 0 correct
1.Which message fits a toast best?
2.You archive two emails and press Undo on the latest snackbar. The first email comes back instead. What kind of bug is this?
3.The app shows "Saved" but the network log shows a 500 error. What should happen instead?
4.How should a web toast be announced to screen readers?
5.Which iOS statement is true?
Key takeaways
- A toast is a short, non-blocking message that disappears on its own. Use it for confirmations and easy Undo, never for errors the user must act on or critical information.
- Android has a Toast (text only) and the Material Snackbar (one action). iOS has no native toast. On the web, toasts usually stack in a corner.
- Timing matters: 4 s or more, longer with an action, and on the web pause on hover and focus.
- Test Undo hard: the right item, several in a row, and after a refresh.
- Classic bugs: success shown after a failure, endless stacking, covering navigation, truncated text and screen reader silence (
role="status").
Finished this page?Nice work, this page is complete!
Mark it as done to track your progress. It's saved in this browser, no account needed.
Its review cards are now in Bites ⚡