# Snackbar URL: /components/snackbar Source: https://github.com/daangn/seed-design/blob/dev/docs/content/components/snackbar.mdx A component that temporarily appears at the bottom of the screen to guide status or results. ## Anatomy ![Composed of Container, Text, Prefix Icon, Action.]() Snackbar component is composed of text and container, and can display Prefix Icon and Action as needed. ## Properties ### Variant ![Variant Property]() Snackbar component provides three types: Default for basic messaging, Positive for completion or success messages, and Critical for error or failure messages. ### Action Property ![Action Property]() Can display auxiliary Action composed of Text. ## Guidelines ### Using Snackbar ![Snackbar usage example]() Snackbar is a component that provides concise feedback through text. Can be used for notifying completion of background tasks like saving/uploading/syncing, or guiding user actions just performed. Also provides auxiliary actions like 'undo' that are valid for short periods. Snackbar should only be used to share low-severity status, and should be avoided in these situations: | Situations to avoid | Alternative | | ------------------------------------------- | ---------------------------------------------------------------------------------- | | Important choices requiring user decision | [Bottom Sheet](/components/bottom-sheet), [Alert Dialog](/components/alert-dialog) | | Warning that must be continuously displayed | [Page Banner](/components/page-banner), [Callout](/components/callout) | | Multi-step guidance or long text | [Help Bubble](/components/help-bubble), [Callout](/components/callout) | ### Snackbar position and layout ![Snackbar position and layout]() Snackbar is positioned at center bottom by default and includes margin in the component itself. Must consider OS safe area when positioning. ![Snackbar position and layout]() When [Floating Action Button](/components/floating-action-button) exists on screen and Snackbar appears, Snackbar is always displayed above [Floating Action Button](/components/floating-action-button). When text is long and wrapping occurs, icon and auxiliary button are center-aligned. ![Snackbar maximum width example]() Snackbar has maximum width specified, and if screen width exceeds it, positioned at screen center. ### Writing content #### Writing concisely Write only the core of the message, briefly. A noun + verb format that shows the result of the user's action first is easier to understand at a glance. #### Whether to add a period depends on the number of sentences Omit the period for a single sentence, but add a period to the end of every sentence when there are two. #### Phrasing things positively Clear, positive phrasing prevents confusion. Prefer a direct phrasing like "Upload complete" over a double negative like "Did not fail." ### Snackbar behavior ![Snackbar behavior]() By default, a Snackbar is shown for 4 seconds. If the message content is long, adjust the display duration so users have enough time to read it. ![Snackbar behavior]() If the user touches and holds the Snackbar, the timer pauses. This lets the Snackbar stay on screen while the user wants more time to read the message. Only one Snackbar is shown on screen at a time. When a new Snackbar occurs, it is automatically added to a queue and shown in sequence once the currently displayed item disappears. ### Using actions ![Example showing a Snackbar Action labeled 'Undo']() Up to 1 secondary action button can be shown on a Snackbar. Keeping it to 1-2 words is recommended so users can quickly grasp it. For the action label, use a word that names a specific action clearly, such as 'Undo' or 'View list', rather than a generic, ambiguous word like 'Cancel' or 'OK'. When an important change occurs, such as adding or deleting content, it's good to show an 'Undo' option alongside it so users can easily revert it. ## Specification Component spec (JSON): /rootage/components/snackbar.json