
A modal dialog should have a clear purpose, an understandable way to finish or leave and predictable focus behaviour. Use it when the task genuinely needs the user's attention before returning to the surrounding interface. A visually dimmed background does not by itself make a dialog accessible or prevent unintended interaction.

Let’s plan your dialog interactions.
Bring your workflow, constraints and open questions. We’ll help you define the requirements and work through a practical next step.
Choose the right boundary
Decide whether the content is a short decision, a small form or work that deserves its own page. Long, deeply nested workflows inside overlays can make navigation and recovery difficult.
W3C's modal dialog pattern describes contained keyboard focus, initial focus and Escape behaviour. Evaluate the implemented component, not only the appearance of its backdrop.
Create an interaction checklist
| Moment | Requirement | Failure to test |
|---|---|---|
| Open | Purpose and title are available | Focus remains behind the overlay |
| Navigate | Controls have a logical sequence | Tab reaches obscured page content |
| Validate | Errors are understandable and reachable | Error appears outside the active context |
| Cancel | Consequences of leaving are clear | Unsent work disappears unexpectedly |
| Complete | Actual outcome is confirmed | Overlay closes after a rejected request |
| Return | Focus resumes usefully | Trigger no longer exists or moved |
For consequential actions, connect the dialog to the approved confirmation process. Do not use Escape or backdrop dismissal to imply a business cancellation already occurred.
Handle asynchronous work honestly
For a hypothetical export dialog, submitting a request may create a background job rather than a finished file. Show the job state or destination accurately. Closing the dialog should have a defined relationship to the job; it should not accidentally cancel or duplicate it.
Revalidate server state and permissions when the user commits the action. The underlying record may have changed while the dialog was open.
Test with the task context
Use keyboard navigation, appropriate assistive technology and enlarged content. Check supported smaller screens where the dialog may need scrolling.
Include validation failure, delayed requests and a trigger removed by the completed action. Focus recovery should support the next task rather than defaulting unpredictably to the top of the page.
Dialog questions
Should every interaction open a modal?
No. Choose a page, inline interaction or dialog based on task complexity and context.
Does adding an ARIA role complete accessibility?
No. Semantics, focus, keyboard behaviour and the usable task all need evaluation.
Pair dialogs with consequence-focused confirmations, and discuss the interaction with Drema's UI/UX team.
This article explains what to build, not legal advice. Rules change; confirm against the current official text before relying on it.

