11
16 Comments

⚡️ UX tip: How to design destructive actions (e.g. delete, turn off)

If the action is reversible

Just complete the action immediately and let the users undo it somehow.

Dropbox undo

Examples:

  • Undo shortcut in MacOS - Cmd+Z
  • Shake device to undo gesture in iOS
  • Undo text link in toast in web apps
  • Undo action in Snackbars in Android

If the action is NOT reversible

Is it VERY serious and will have a major impact?
Then throw an alert asking for confirmation in a very explicit way.

Github repo delete

Is it less serious and won't have a major impact?

Throw a basic alert asking them to confirm.

example

Or make confirmation part of the UI interaction

Example #1: Turning off an iPhone - Slide to turn off

Example

Example #2: Removing an app from MacOS dock - Hold for 2 seconds and release to remove

Example

Example #3: Deleting an item from a list in iOS - Swipe all the way to delete

Example

Get 1% better at UX every week

Subscribe to get notified when I publish new UX articles

  1. 1

    In some products (more technical, archived, or code oriented) I find useful to add both the explicit alert and once they accepted another alert asking them to confirm.

    Anyway, I usually like to add a trash can on that second step (for 48h) they can recover that, is like an external “undo” and they might need to add some external efforts to add that again if it was a big delete.

    And even sometimes when there’re people involved in an action (shared folder or something like that). I like to add a confirmation to the other users or if the “admin” delete it at least sending an email to the other people involved with the “external undo” if they need to recover that.

  2. 1

    Some nice tips here. Thanks for that!

  3. 1

    I actually think this is a bad tip — the user ends up forming a habit to mindlessly confirm after doing the delete action. In general, it's better to allow the user to undo: https://alistapart.com/article/neveruseawarning/

    Obviously, that doesn't work for truly destructive actions. But when something can be easily and quickly reversed, like removing a dock icon or deleting a screenshot, just get out of their way and let them undo if they make a mistake!

    1. 1

      I totally agree and I realised the way I described it is misleading. Undo is 100% a great UX practice and good to follow.

      Also asking for confirmation is a great UX pattern but it depends on the context of use (for example how much impact can the deletion of an entity can have - e.g. delete github repo)

      Now that I think about it again I feel the good / boring UX approach wasn't that good of an idea to present these 😅

      Thanks a lot for the feedback! 🙏

      P.S. Updated the article

  4. 1

    Do you have any suggestions for how to do this in a typical web app? Obviously iOS-like touch interactions are not typical on a web app. Thanks!

    1. 1

      The delete could be done by dragging a UI item and dropping in a "Trash bin" icon that shows up once you start dragging it.

      For mobile web you can also copy the ones from iOS and replicate them.

      I will try to search for some examples and will update the article if I find any :)

    2. 1

      Maybe a toast notification with the option to undo last change? That's what I'm thinking of implementing in my app.

      1. 1

        I think this is the most common practice, and I think it's ok, but I'm not a huge fan. I'm not sure if I can think of anything better though.

      2. 1

        That's a good idea indeed - just delete the item and let them undo it if they want

  5. 1

    These are some really interesting examples @jimzarkadas!
    I'm thinking of creating couple of such new interactions for my product ruttl as well! You might wanna check them out!

    1. 1

      Thanks! Will check it out

  6. 1

    This comment was deleted a year ago.

    1. 2

      Damn my bad that was a typo - fixed and updated it :)

  7. 1

    This comment was deleted 9 months ago.

    1. 1

      As I commented above to @jakelazaroff I will update the article cause the way I presented the ideas was finally misleading.

      Undo and asking for confirmation are both great UX patterns. The parameters that defines which method to use are:

      1. If action can be undone
      2. If not how serious is it to delete that entity (e.g. delete a github repo)

      Thanks a lot for your feedback and will update it soon!

      P.S. Updated the article

Trending on Indie Hackers
I talked to 8 SaaS founders, these are the most common SaaS tools they use 20 comments What are your cold outreach conversion rates? Top 3 Metrics And Benchmarks To Track 19 comments How I Sourced 60% of Customers From Linkedin, Organically 13 comments Hero Section Copywriting Framework that Converts 3x 12 comments Promptzone - first-of-its-kind social media platform dedicated to all things AI. 8 comments How to create a rating system with Tailwind CSS and Alpinejs 7 comments