Undo

Also called undo toast or undo button

A way to reverse an action right after doing it, often a toast with an Undo button that appears after deleting or archiving something.

What is Undo?

Instead of asking "Are you sure?" before every delete, the app does what was asked right away and shows a short message with an Undo button, usually for 5–10 seconds. Pressing Undo puts the item back exactly where it was. Gmail’s "Conversation archived" message with its Undo link is the classic example.

Undo works better than a confirmation dialog for frequent, reversible actions such as deleting a task, archiving an email, or removing a file from a list. People click through confirmation dialogs out of habit, while undo lets them fix a mistake once they notice it. Keep confirmations for actions that truly can’t be reversed.

Behind the scenes, either wait until the toast closes before deleting for real, or soft-delete right away (mark the item as deleted) so Undo can restore it. Keep the toast open while the pointer is over it or it has keyboard focus, and support ⌘Z (Ctrl+Z on Windows) where people expect it.

All terms

Toast notification

A brief message that slides into a corner of the screen to confirm an action, then disappears on its own after a few seconds.

Optimistic UI

A pattern where the interface shows the result of an action right away, before the server confirms it, and rolls it back if the request fails.

Modal

A window that opens over the page, dims everything behind it, and blocks the rest of the interface until you finish or dismiss it.

Swipe to dismiss

A gesture where you drag an item sideways past a threshold to remove it, while a shorter swipe lets it spring back into place.