Snackbars and toasts
Cross-platform differences
Terminology
To adhere to platform standards, Spectrum uses different terms for its user feedback mechanism across Android and iOS. Android uses the term “snackbar,” while iOS uses the term “toast.” Although the names are different, they describe the same concept.
Position
By default, the Android snackbar sits centered at the bottom of the screen, and the iOS toast sits at the top. However, in contexts where the default position conflicts with core editing panels, you can reposition both snackbars and toasts on the opposite side of the screen.
Dismissal
The Android snackbar offers an optional close icon button as its primary manual dismissal affordance, following Material Design patterns. The iOS toast instead relies on swipe, the familiar dismissal pattern on the platform, and also supports auto dismissal. When either platform uses auto dismissal, you can set it to dismiss after a short (4 seconds on Android, 3 seconds on iOS), medium (6 seconds), or long (10 seconds) timeframe. When TalkBack and VoiceOver are on, the timings double.
If the user taps an iOS toast set to auto-dismiss, the tap cancels the auto-dismissal, and the toast persists until the user dismisses it manually. This functionality is unavailable on Android.
Iconography
The Android snackbar uses predefined semantic icons only (informative, positive, notice, negative), avoiding decorative icons in a transient message. These semantic icons do not include semantic color, conveying meaning through shape alone. This matches Material Design’s neutral snackbar appearance. The iOS toast allows for the same predefined semantic icons as Android. In the rare case where these semantic icons are not sufficient, designers can use additional Spectrum icons. The semantic icons have a semantic color applied to them.
Anatomy
Android component options
StyleNeutral Informative Positive Notice NegativeShow buttonShow close iconTextStyle
The snackbar has five available style variants for various messaging types.
Neutral
The neutral variant is the default snackbar. Use this when the message is neutral in tone or when its semantics do not fit in any of the other variants. Most snackbars should use the neutral variant. Only use the other variants when the situation exactly matches their description.
Informative
The informative variant uses an info icon to convey the message tone. Use this when the message needs to draw more attention than the neutral variant.
Positive
The positive variant uses a checkmark icon to convey the message tone. Use this to inform users that a complex task was completed successfully.
Notice
The notice variant uses a diamond "alert" icon to convey the message tone. Use this to warn about a situation that may need to be addressed soon.
Negative
The negative variant uses a “triangle” alert icon to convey the message tone. Use this to show an error or failure.
Show button
A snackbar can optionally have up to one action. Keep the label concise, and use it only when there’s a direct, related action available. The action should also be available elsewhere within the app’s interface since the snackbar auto-dismisses. Don't use the action to dismiss the snackbar.
Show close icon
This boolean choice allows you to add a close icon to the trailing side of the snackbar.
Text
Type the text label to show in your snackbar.
iOS component options
VariantNone Informative Positive Negative NoticeTitleDescriptionPreferred widthHug contents Fill containerPositionTop BottomOffsetAction buttonAuto dismissNone Short Medium LongTitle
Type the text label to show in your toast.
Description
Avoid descriptions as much as possible. Try to use shorter messages that don’t necessitate a description or use another component entirely if it cannot be avoided. Reserve toasts for short, concise messages.
Preferred width
You can set toasts to hug or fill. On larger devices, toasts set to fill will never exceed the width of iOS’s readable content guide.
Position
By default, the toast is centered at the top of the screen, below the top safe area. However, it can be configured to appear centered at the bottom of the screen if the default position interferes with core editing panels.
Offset
The offset property allows engineers to adjust the toast’s distance from the top or bottom safe areas. Safe areas are the regions at the top and bottom of the screen that contain system UI. At the top, this includes the battery, clock, and Wi-Fi indicators. At the bottom, it includes the home indicator.
Action button
A toast can optionally have up to one action button. Keep the button’s label concise, and use it only when there's a direct action related to the toast text. The action should also be available elsewhere within the app’s interface since the toast auto-dismisses. Don't use the action to dismiss the toast.
Presets
Informative
The informative variant uses an info icon to convey the message tone. Use this when the message needs to draw more attention than the neutral variant.
Notice
The notice variant uses a diamond "alert" icon to convey the message tone. Use this to warn about a situation that may need to be addressed soon.
Positive
The positive variant uses a checkmark icon to convey the message tone. Use this to inform users that a complex task was completed successfully.
Negative
The negative variant uses a “triangle” alert icon to convey the message tone. Use this to show an error or failure.
Behaviors
Triggering
Because snackbars and toasts are transient messages, not all actions are appropriate triggers for them. Simple notifications and low-priority alerts are good candidates. Errors are not. When it comes to confirmations, first ask yourself if there is another way the user would know the action was successful. Is there a new item present? If so, perhaps that's enough to tell the user the app successfully created the item. If there is no other way, then a snackbar or toast might be appropriate for a confirmation.
Remember that the goal is not to have as many snackbars and toasts as possible, but rather to only have the ones the experience absolutely requires.
Duration and dismissal
When choosing an auto-dismissal delay, match the duration to the amount of text in the snackbar or toast, keeping in mind that users will spend part of that time noticing it, not just reading it.
Stacking and queuing
Snackbars and toasts appear one at a time. Subsequent snackbars or toasts appear after the user or the system dismisses the preceding snackbar or toast (manually or automatically). On Android, a snackbar with updated information can immediately replace an outdated snackbar rather than waiting in the queue. For example, a user might save an item to favorites and then quickly remove it before the first snackbar dismisses. This option is not available on iOS.
Positioning and movement
Android
Snackbars use a scale animation to enter from the bottom of the screen to rest just above the navigation bar. On scroll, the snackbars stay where they are; they do not scroll with the rest of the page content.
In compact breakpoints (under 600 dp), snackbars span the full width of a device, bounded by left and right margins. Text and actions align along the horizontal axis until wrapping becomes necessary.
At medium breakpoints (600 dp+), snackbars hug their content until they reach their maximum width, which is determined by line length.
iOS
By default, toasts animate in from the top of the screen and rest just below the safe area, and on top of the toolbar. On scroll, they stay where they are; they do not scroll with the rest of the page content. You can set toasts to animate in from the bottom and position them just above the tab bar if necessary.
iOS toasts can be set to hug or fill. On larger devices where they are set to fill, they will never exceed the width of iOS’s readable content guide.
Haptics and motion
Haptics
Snackbars and toasts support optional haptics on dismissal only. Entry does not trigger haptic feedback.
Motion
On both platforms, the snackbar or toast exits in the direction from which it entered. This keeps the motion predictable and doesn't distract from the content of the message itself.
Android
The snackbar scales up and away from the entry point, and does the inverse on exit.
iOS
The toast slides down from the top of the screen on entry, and exits back up the way it came.
Usage guidelines
When to use
- Confirming a completed complex task when the result is not immediately obvious.
- Providing lightweight system status updates, for example, sync complete, connection restored.
- Surfacing non-critical background results the user doesn't need to act on immediately.
When not to use
- Anything requiring a decision or input before proceeding.
- Persistent or critical system states the user must not miss.
- Content the user needs to reference later or re-read. Toasts and snackbars are ephemeral by nature.
- As the sole confirmation for destructive, irreversible actions. Use a confirmation step beforehand instead.
Severity & type variants and their appropriate use
- The neutral style variant is the default snackbar. Use this when the message is neutral in tone or when its semantics do not fit in any of the other variants.
- The informative variant uses an information icon to convey the message tone. Use this when the message needs to draw more attention than the neutral variant.
- The positive variant uses a checkmark icon to convey the message tone. Use this to inform users that a complex task was completed successfully.
- The notice variant uses a diamond “alert” icon to convey the message tone. Use this to warn about a situation that may need to be addressed soon.
- The negative variant uses a “triangle” alert icon to convey the message tone. Use this to show an error or failure.
Frequency & restraint
If you're not sure, leave it out.
- More snackbars and toasts isn't the goal, the right amount is. A lot of the time the interface changing on its own (abutton flipping states, an item showing up in a list) is enough feedback without adding a snackbar or toast on top.
Anything critical shouldn't live exclusively in a snackbar or toast.
- Because they're transient and easy to miss, you should also make critical content and actions available somewhere persistent and discoverable (a notification center, inline status, etc.).
Skip the snackbar or toast if success occurs in the background
Actions that are supposed to work quietly in the background, such as autosaves and background syncs, don’t need confirmation through a snackbar or toast.
Don't create multiple snackbars or toasts for one bulk action
If someone deletes 12 items at once, they don't need 12 snackbars or toasts. One summary does the job: “12 items deleted.”
Internationalization
Accessibility
Reduced motion
Both the Android and iOS components respect the OS-level reduced motion setting. You don’t need to do additional work to respect this setting.
Minimum display duration
Auto-dismiss timing should account for reading time, not just a flat default. Give users enough time to notice the snackbar or toast, read it, and react to it, especially if it has an action button attached.
Icon labels
Android
Icons in the snackbar are monochromatic and part of the system default. You can't customize them, and the code already includes their accessible name. You don’t need to do additional labeling work.
iOS
The default toast types (Informative, Positive, Negative, Notice) already have accessible names built in. But since iOS toasts support custom icons and images, you must manually supply an accessible name for any custom icon you add outside those default types.