# Snackbars

{% embed url="<https://material.io/components/snackbars/>" %}

![](https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1hJm24PlwoTxWrIMhkPE0RV2Q-ahyQVZq%2Fsnackbars-container-do.png)

## Usage&#x20;

Snackbars inform users of a process that an app has performed or will perform. They appear temporarily, towards the bottom of the screen. They shouldn’t interrupt the user experience, and they don’t require user input to disappear.

#### Frequency

Only one snackbar may be displayed at a time.

#### Actions

A snackbar can contain a single action. Because they disappear automatically, the action shouldn’t be “Dismiss” or “Cancel.”

### Principles

#### Informational

Snackbars provide updates on an app’s processes.

#### Temporary

Snackbars appear temporarily, and disappear on their own without requiring user input to be dismissed.

#### Contextual

Snackbars are placed in the most suitable area of the UI.

### When to use

Snackbars communicate messages that are minimally interruptive and don’t require user action.

| **Component** | **Priority**               | **User action**                                                                                           |
| ------------- | -------------------------- | --------------------------------------------------------------------------------------------------------- |
| Snackbar      | Low priority               | Optional: Snackbars disappear automatically                                                               |
| Banner        | Prominent, medium priority | Optional: Banners remain until dismissed by the user, or if the state that caused the banner is resolved  |
| Dialog        | Highest priority           | Required: Dialogs block app usage until the user takes a dialog action or exits the dialog (if available) |

## Anatomy

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1nLgv9qK6Jo_4I3kYXrPvEqxyuFYH96st%2Funderstanding-snackbars-elements.png" alt=""></div>

1\. Text label

2\. Container

3\. Action (optional)

### Text label

Snackbars contain a text label that directly relates to the process being performed. On mobile, the text label can contain up to two lines of text.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1OMk570U3TV7FknWEmvGbKNudV1j41J4M%2Funderstanding-snackbars-text-1-line.png" alt="Text labels are short, clear updates on processes that have been performed."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1-xoqfCjbmAnpAKbFVG7AIjqShi_vq_AM%2Funderstanding-snackbars-text-2-lines.png" alt="【Do】On mobile, use up to two lines of text to communicate the snackbar message."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1lpgBDriYaHx2p9RjqRVh_ELYcEJfVWvD%2Fsnackbars-text-desktop.png" alt="【Do】In wide UIs like desktop and tablet, snackbars should have only a single line of text."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1_u7D-s8fZquh7lCo8cHsenum8sMzFCq3%2Funderstanding-snackbars-text-dont-icon.png" alt="【Don’t】Don’t place icons in snackbars. If your message needs an icon, consider using an alert."></div>

###

### Container

Snackbars are displayed in rectangular containers with a grey background. Containers should be completely opaque, so that text labels remain legible.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1hJm24PlwoTxWrIMhkPE0RV2Q-ahyQVZq%2Fsnackbars-container-do.png" alt="【Do】Snackbar containers use a solid background color with a shadow to stand out against content."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1bwx9T5zFZrLre5w09OkSgJ19ByYy-JTT%2Fsnackbars-container-desktop-do.png" alt="【Do】In wide layouts, extend the container width to accommodate longer text labels."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1AheBOIjnaLseyXOPmu5Qc2UMVdTq0q6k%2Fsnackbars-container-caution-transparent.png" alt="【Caution】An app can apply slight transparency to the container background, as long as text remains clearly legible."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1GI5IPIZkhyZT3gTwgDzlvyjH_RUqmGTJ%2Fsnackbars-container-don-t-shape.png" alt="【Don’t】Avoid significantly altering the shape of a snackbar container."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1NrWW17H4yDvkA97lDk-JnlSl3etrHpFc%2Fsnackbars-container-caution-no-shadow.png" alt="【Don’t】Avoid displaying a snackbar container without elevation."></div>

### Action

Snackbars can display a single text button that lets users take action on a process performed by the app. Snackbars shouldn’t be the only way to access a core use case, to make an app usable.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1ZORD4WmF49zG1CbqtOBGGjJKd8gO5Dlg%2Funderstanding-snackbars-action-color.png" alt="To distinguish the action from the text label, text buttons should display colored text."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F10-vdAym8XUqnrT1fwUUW5pXyVaBc-MGg%2Fsnackbars-action-dont-color.png" alt="【Don’t】The text label shouldn’t share the same color as the text button."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F17MT7avNVdB_XtNUPz5DYe7ZCXEba1vrS%2Fsnackbars-action-dont-elevated-btn.png" alt="Don’t.  Don’t use a filled or elevated button in a snackbar, as it draws too much attention."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F11e9M-CnUBfAefLLAMtckb_opQih-E3Gm%2Funderstanding-snackbars-text-2-lines-longer-action.png" alt="【Do】If an action is long, it can be displayed on a third line."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1fEFOwmVqINLsJmwK-EDI_tixoFNHSba3%2Funderstanding-snackbars-action-undo.png" alt="【Do】To allow users to amend choices, display an &#x22;Undo&#x22; action."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1YL78lie7hfbu5vMyrmV_tzvpKL7CQrLt%2Fsnackbars-action-caution-dismiss.png" alt="【Caution】A dismiss action is unnecessary, as snackbar disappears on their own by default."></div>

## Behavior&#x20;

### Appearing and disappearing

Snackbars appear without warning, and don't require user interaction. They automatically disappear from the screen after a minimum of four seconds, and a maximum of ten seconds.

{% embed url="<https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1smqQHvwlE8Nm5nNwHXgvnJ9JDrOt_CB1%2F01-appear.mp4>" %}

###

### Consecutive snackbars

When multiple snackbar updates are necessary, they should appear one at a time.

{% embed url="<https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1Ox5qX5je_tUiv8P9V9tTfGRTd3RTsvxh%2F02-appearconsecutive.mp4>" %}
Consecutive snackbars should appear above persistent bottom navigation.
{% endembed %}

{% embed url="<https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1hSb4Cnon01EoKlsxAVHiJ2eIpsfsbYCd%2F02-appearconsecutive-dont.mp4>" %}
【Don’t】Avoid stacking snackbars on top of one another.
{% endembed %}

{% embed url="<https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1wbCENhhDF1dJ5a0597z8EVDM2qDLyy3w%2F02-appear-dont.mp4>" %}
【Don’t】Don’t animate other components along with snackbar animations, such as the floating action button.
{% endembed %}

###

## Placement&#x20;

### At the bottom of the UI

Snackbars should be placed at the bottom of a UI, in front of app content. Avoid placing a snackbar in front of frequently used touch targets or navigation.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F110TBkEZ4GFJrLLzyB96mfOtx1DvPBGA-%2Fsnackbars-layout-do.png" alt="Place a snackbar in front of content."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1614tR5yF9nT7qKRrEpO7sb89pBQrW336%2Fsnackbars-layout-don-t-bottom-bar.png" alt="【Don’t】Avoid placing snackbars in front of navigation components."></div>

Snackbars can span the entire width of the screen only when a UI does not use persistent navigation components like app bars or bottom navigation bars. Snackbars that span the entire width of a UI can push only FABs up when they appear.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1AlECh_HLxZMx1wYFoGCk1uSTpXMjlkPY%2Fsnackbars-layout-don-t-edge-to-edge.png" alt="【Caution】Snackbars can span the entire width of a UI. However, they should not appear in front of navigation or other important UI elements like floating action buttons."></div>

###

### Snackbars and floating action buttons (FABs)

Snackbars should appear above FABs.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1BlhZYfz9EClmRaSVq-sPLwyXVGEQKDlj%2Fsnackbars-layout-fab.png" alt="Snackbar above a FAB"></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1_ZrPvLSAYi51IEBunxswjYcHF259G00D%2Fsnackbars-layout-fab-dont-1.png" alt="【Don’t】Don’t place a snackbar in front of a FAB."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F150zZV4EXnNCKaLNEFucwwGy1210g2PR2%2Fsnackbars-layout-fab-dont-2.png" alt="【Don’t】Don’t place a snackbar behind a FAB."></div>

###

### Snackbars and persistent footer elements

Snackbars should appear directly above persistent footer elements.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1Gkbg2JiXndIslRC_xZvwEWp3t0PD1DgX%2Fsnackbars-layout-do-navigation.png" alt="Snackbar above persistent footer elements"></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1B19qxKNDDwFn4wYave2LAtyuXfX18WWV%2Fsnackbars-layout-sheets-extended.png" alt="【Do】Place snackbars in front of medium extended sheets."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1brTnLGSb_xzBkMBQ2ZjQ47VZjnJRVfoe%2Fsnackbars-layout-don-t-push-bottom-bar.png" alt="【Don’t】Avoid pushing bottom persistent elements up when snackbars appear."></div>

###

### Snackbars in wide layouts

In wide layouts, snackbars can be left-aligned or center-aligned if they are consistently placed on the same spot at the bottom of the screen.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1g53jKUH6a5wejAcF2n542pviFHkZXxw_%2Fsnackbars-layout-desktop-do.png" alt=""></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F11iRJMqJLi_rL7QCbKYJbyeoxmkkOKZ3o%2Fsnackbars-container-landscape-do-2.png" alt=""></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F15PKv_tKP2BwCiapzFGq9_Jo2LFODsPqa%2Fsnackbars-container-desktop-dont-flush-edge.png" alt="【Don’t】Avoid placing snackbars flushed to one edge of the layout."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1L3VUEbB7iQ0MBHIpeRYevu3zQpDPYfHH%2Fsnackbars-layout-desktop-dont-side-to-side.png" alt="【Don’t】Avoid placing consecutive snackbars side by side or next to one another."></div>
