We use modal dialogs in our web application for actions such as deleting or creating an entity. These modals could be rendered as "on page actions", which are stateful and relative to the current page, or, these modals could be rendered under a separate route, e.g. mycoolapp.com/projects/create (without changing the design of the page). Using modern web technologies such as React, there need not even be a page refresh for the route (while still altering the browser's history stack).

Personally, I believe there are plenty of benefits in using separate routes for modals:

  • Altering the browser's history stack enables entering or exiting the modal using backwards and forwards navigation
  • Since these actions / pages have a specific link, they can be referenced and shared either by people (sending the link to create a new project to a coworker), by support staff, or in the documentation

Researching this topic, I wasn't able to find any good resources that investigate this topic. What is your opinion on this topic? Are there any established standards and best practices on whether modals should have separate routes?

  • 1
    This sounds like an implementation issue. If the user is essentially unaware of this addressing method and the resulting UI appears in a way that is 'normal' (predictable and as expected) to the user the I'm not sure why this would be a problem. Mar 13, 2023 at 9:36
  • The question is whether this implementation detail offers a better user experience by enabling the outlined benefits (without introducing any drawbacks).
    – qsi
    Mar 13, 2023 at 9:52
  • 1
    The benefits you described (back button to escape the modal and a shareable link) are possible to deliver using scripting (History and back button manipulation) and query strings/server-side scripting (Shareable links to specific page states). It is also unusual to share a modal window - you might need to conduct some research with your users to see if this is actually the problem you should be solving for them. Mar 13, 2023 at 11:08


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.