Snackbar

v2.0.0

Snackbars are temporary messages that provide immediate feedback about a user action. They communicate the success or failure of an action, with an optional button to revert a decision, correct a failure, or dismiss.

  • Skin
  • CoreUI
  • React
Stylized graphic for a snackbar.

Considerations

Temporary

Snackbars appear and disappear after a set amount of time.

Brief

Snackbars are short and concise.

Responsive

Snackbars provide feedback about the processing of a user action.

Anatomy

Anatomy of a snackbar. Number 1 points to the container. Number 2 points to the body text. Number 3 points to the action link button.
  1. Container
  2. Body
  3. Action

Properties

Body

The body of the snackbar is required and informs that something occurred. The message should be as concise as possible.

A snackbar with the body “Size successfully updated!” There is no action.

Action

Snackbars can contain a single action. The label should be a verb, contain no more than two words, and relate directly to the action that was taken.

For default messages, this can be an undo, a link to a relevant list, or an explicit dismiss action. For error messages, the action can attempt to resubmit data or navigate the user somewhere to address the issue.

A snackbar with the body “Item deleted from watchlist” and the action “Undo”.

Critical

Snackbars use an attention icon to the left of the message when an issue occurs.

Because snackbars are transient, it is advisable to use a different pattern like dialog for high-priority issues.

An critical variant of the snackbar. There is an attention icon with the body “There was an issue saving this item” and the action “Try again”.

Behavior

Text overflow

Snackbars with longer messages will wrap and the action will move below the text. This layout is also preferred if the action label is longer. Aim for no more than two lines of text for the body.

A critical variant snackbar with two lines of body copy. The “Try again” action is stacked below the body in the bottom right corner of the container.

Width

Snackbars have a maximum width of 448px. They can span full width minus insets on small screens up to the maximum width.

A snackbar with an indicator showing its max width is 448px.

Placement

Snackbars appear bottom center on all screen sizes. They can span full width minus insets on small screens but adhere to a maximum width at larger screen sizes.

Snackbars animate upward from the bottom of the screen and downward off screen when dismissing.

A mobile and large screen with snackbars positioned at bottom center on each.

Offset

Snackbars are offset 16px above persistent elements pinned to the bottom of the screen. If there are no persistent elements then the snackbar should be offset to clear any navigation hardware. They are inset 16px when fullwidth on smaller screens.

A snackbar on a mobile screen. It is full width with 16px of space on the left, right, and bottom.

FAB interaction

While some platforms default to the snackbar above the floating action button (FAB), the preferred placement is below.

A snackbar on a mobile screen. It is placed below a floating action button (FAB).

Dismiss

Snackbars can be dismissed by the action button, timing out, or via a downward swipe gesture.

A snackbar with a swiping indicator hinting that swiping downward dismisses it.

Timeout

Snackbars appear from the bottom of the screen with a default timeout of 6 seconds (6000ms). The timing begins when the component loads into view and the message will dismiss automatically after the timeout if the user continues interacting with screen content.

Users can dismiss a message anytime via a downward swipe gesture.

A graphic illustration of a snackbar floating upward, starting it’s time counter at 0, moving to 6000ms, and then floating downward.

Screen sizes

Small

Snackbars appear at the bottom center of the screen on small screens.

A snackbar on a small screen. There is no tab bar, but the snackbar hovers comfortably above the bottom of the screen.
A snackbar on a small screen. It sits above the tab menu.

Medium and large

Snackbars are aligned bottom-center on larger screens.

A snackbar on a large screen. It is placed center bottom.

Best practices

Consecutive messages

Do replace existing snackbar messages with newer ones.

A single snackbar.

Don’t allow multiple snackbars to appear at once. Snackbars do not stack.

Three snackbars stacked.

Placement

Do keep snackbars centered along the bottom of the screen.

A snackbar on a large screen anchored to the bottom.

Don’t customize the placement of snackbars.

A snackbar on a large screen anchored to the top.

Content

Do keep snackbar messages as short as possible, with no more than two lines in English, and use generic language for items.

A snackbar with a single line of body copy “Item saved for later”.

Avoid being overly verbose within snackbar messages. Being overly-specific can negatively affect localization and scalability.

A snackbar with three lines of body copy “Sportswear super cushioned running shoe size 12 with colored accents removed from watchlist”.

Snackbar vs. dialog

Do use snackbars for messages or alerts that don’t need to completely interrupt an experience.

A snackbar with the body “Your file has been uploaded”.

Don’t use snackbars for high-impact decisions that require user attention or a response.

A snackbar with the body “This address will be permanently removed” and action “Delete”.

Frequency

Do use snackbars for targeted actions such as updating payment options, making changes to the cart, and reporting an item.

A mobile cart screen. “Save for later” is tapped and a snackbar appears with “Item saved for later”.

Don’t use snackbars for quick, repetitive actions such as watching multiple items in a grid of options. Too many snackbars after each other are disruptive to the experience.

A mobile search results page where each item tile save action triggers a snackbar with “Item added to Watchlist”.

Specs

Specs for snackbars. The top is a simple snackbar with a body and action. There is 16px of padding all around the container and on the left of the action. The bottom is a critical variant snackbar. It contains the same padding around the container, a 16px icon in the upper left, 12px between the icon and body, and the action is in the lower right corner.

Change log

VersionDateNotes
2.0.0
Aug, 2024
  • Added “FAB” guidance under behaviors
  • Updated to eBay Evo
2.0.0
Apr, 2022
  • Updated background to use bg.inverse for increased contrast
  • Added property for button location below or beside content
  • Added critical variant for low to mid-level errors
1.0.0
Feb, 2020
  • Initial component published