Modals can just be awkward
September 30, 2026Some modals are really bad. 1
But even the good ones can be awkward.
1 - Sorry, I can't send you a link to that
Suppose we are implementing a page with a list of products, and clicking on a product opens a modal which shows product details. How can the user share a link to those product details with someone else? Since it's not a page it doesn't have a URL of its own and there is no link to share.
2 - How do I re-open that?
We can solve 1 by updating the URL with something like this:
/products?productId=xyz
Now consider what happens if I open the link, proceed to close the modal, and then want to open it again.
It's possible that the product was not actually displayed in the product list, and I have no way to open it again.
3 - Browser history to the rescue?
If our updated URL adds entries to the browser history, then 2 can be solved by just hitting the browser "back" button. Of course, not everyone will realize that they can hit "back" and get back to the modal. Even if they do, do we even want this?
I'd argue not really. Having modals open and close in response to the back/forward buttons in the browser is often going to just be unexpected.
It's awkward.
Use pages instead
Pages do not have any of the problems listed above. Pages have URLS. They can be re-opened with links. Users understand that they can re-visit pages by moving forward and backward through their browser history. 2
Modal rules of thumb
Here's where I think modals are ok to use:
- Using a modal for confirming an action is fine.
- If the user clicks a button to display a help message, it's fine to display that in a modal.
- If you need to display an urgent notice to new users, a modal could be fine for that too.
-
Really bad modals
- Fail to lock scrolling on the page behind the modal
- Fail to trap keyboard focus in the modal
- Are missing attributes like
role="dialog"andaria-labelledbywhich is not ideal for screen readers
- I hope anyway. If they don't, you may have bigger problems.