Hacker News new | ask | show | jobs
Cancel as a Link or a Button? (UX) (medium.com)
2 points by karimmaassen 1544 days ago
2 comments

It's a destroy modal action, so it's a button. In other words, you are still at the same place.

Changing the subject, the underlying problem is abusing modals. One for "Your session is about to expire" that's OK, but for "Add Fruit" you can create an editable new fruit row and allow undoing the action(s).

BTW, in my app, I only use "Cancel" for having an element to focus on when there's a destructive action. Other than that, the user can click outside the dialog. Which I mention to ask you: do make the click area outside the dialog a link as well?

But you would not be destroying data. It's an UI interaction which you're applying (i.e. closing the modal view, and thus navigating back to the previous state of your UI).

I agree with you that modals are abused. Modals should - in my opinion - be used for immediate actions such as your example.

Side panels however are fine in my book. In the end, we're talking about the same thing: example.com/fruits/new - Navigating (there you have it) to this URL should provide the user with an interface to fill out a form to create a new fruit.

In practice this could just as easily be a side panel triggered from the fruits list page, by clicking on the "new fruit" link. The URL should reflect that UI state change.

I mean, I only use "Cancel" to focus on next to non-undoable actions.

---

Also, link vs. button is an a11y concern and the guidelines use buttons: https://www.w3.org/TR/wai-aria-practices-1.1/examples/dialog...

Which one is UX best practice and why? A small exploration as to why one is preferred over the other.