Undoable action

Instead of asking 'are you sure?', do the thing and offer an undo. Reversal beats confirmation for almost everything.

the little undo barlet them take it back instead of askingundo toastun-doable actionreversible actionundo instead of are-you-surectrl+z for the whole appsoft delete with a take-it-back button

See it

Live demo coming soon

What it is

An undoable action does the thing immediately and hands the user a short window to reverse it, usually a snackbar that says 'Deleted. Undo.' It replaces the confirm dialog, which interrupts everyone to protect the rare mistake. Gmail's 'Undo send' is the canonical version: nobody is asked whether they meant it, they just get five seconds to change their mind.

Reach for it whenever the action is cheap to reverse: archive, delete a row, reorder a list, mark as read, apply a filter. Keep the confirm dialog only for the genuinely irreversible stuff (wiping a workspace, sending money), where there is no state left to restore. Under the hood you are either soft-deleting (flag the record, purge later) or holding the write until the undo window closes.

The gotcha: an undo affordance that disappears before the user notices it is worse than no undo, because you skipped the confirm and gave nothing back. Give it real time (5 to 10 seconds), pause the timer on hover, keep the snackbar out from under the thumb, and make sure undo also restores scroll position and selection, not just the data.

Ask AI for it

Make this action undoable instead of confirmed. Remove the confirmation dialog, perform the action immediately with an optimistic UI update, and show a snackbar at the bottom with the past-tense result plus an 'Undo' button (for example 'Item deleted. Undo'). Keep the snackbar visible for 8 seconds, pause the countdown while hovered or focused, and dismiss it on Escape. Implement undo by soft-deleting (set a deletedAt flag) and only committing the hard delete when the window expires; restore the row in its original list position on undo. Announce the snackbar to screen readers with role='status' and keep the undo button keyboard reachable.

You might have meant

escape hatchdestructive action confirmationoptimistic rollbackuser control and freedomerror recovery

Go deeper