Skip to main content
FeedbackLevel 2

Snackbar

带操作提示条

WebMobileDesktopDifficulty: Medium

Looks much like a toast, except it carries one optional action button at the bottom — typically "Undo".

01

Live Demo

Actually clickable

Currently: 3

After deleting, a bar with "Undo" slides up from the bottom. The difference from Toast: it has one thing you can click.

What you just saw:The "Message deleted · Undo" bar at the bottom of Gmail after deleting an email, the "Ad skipped · Restore" bar at the bottom of YouTube after dismissing an ad — both have a tappable action.

02

What it actually is

The only difference between a snackbar and a toast is whether it can do something. The moment it offers an undo button it becomes the safety net for dangerous operations. That is also why Google insists deletes get a snackbar rather than a confirmation dialog.

snackbaraction barundo barmaterial snackbarundo snackbar
03

Anatomy · What it's made of

  1. Container容器

    Usually centered at the bottom of the screen

  2. Message消息

    Passive voice: "Message deleted"

  3. Action操作按钮

    Such as "Undo" or "Retry"

  4. Duration时长

    Give it 5–10 seconds when there is an undo

04

When to Use

When it fits, and when it doesn't
Snackbar usage recommendations
SituationUse it?
You want to offer an undo after a delete, move, or similar operationYes
The action already took effect and the user might change their mindYes
You want to avoid the interruption of a confirmation dialogYes
You only need to report success with no follow-up action at allDepends

If the undo window is only 3 seconds, that is too short for important content — either extend the duration or use a confirmation dialog.

When there is a bottom navigation bar, the snackbar has to shift up or the nav bar will cover it.

05

Similar Patterns

Don't mix these up
Full comparisonToast vs Snackbar vs AlertThe action is done and I want to acknowledge it. Which one?See the table
06

How to tell AI

Three levels of prompt

Add the component name and specifics

After a photo is deleted, show a snackbar at the bottom: "1 photo deleted" plus an "Undo" button, auto-dismissing after 5 seconds; shift it up by 80px when there is bottom navigation.

07

Don't just say this to AI

Bad → Better

Don't say this to AI

Show a confirmation after deleting.

Say this instead

After a delete, show a bottom snackbar: "1 photo deleted" + an "Undo" text button, auto-dismissing after 5 seconds (countdown pauses on hover), shifted up when there is bottom navigation, with role="status" + aria-live="polite".

08

Share this card

Social-ready

Turn this pattern into a 3:4 or 1:1 knowledge card and export it as PNG right in the browser. No backend needed.