Keeps the user's focus inside a pop-up until dismissed
Clarity
Use modals only when needed for focused tasks, and keep the content short and easy to understand.
Easy interaction
Modals should be simple to open and close without disrupting the user’s flow.
Accessibility
Make modals accessible by using proper ARIA roles, labeling, and managing keyboard focus.
Use modals to:
Used to block user interaction during critical process, such as submitting a form or processing a payment. If a process takes longer than a minute, consider using progress bar instead of spinner.
Keep content concise
• Give the modal a meaningful title or heading
• Limit the amount of content to prevent cognitive overload
• Use clear, simple language—especially for alerts or confirmations
Actionable buttons
• Always include a primary action (e.g., “Save,” “Confirm,” “Delete”) and a secondary action (e.g., “Cancel,” “Close”)
• Ensure button labels are descriptive and represent the action clearly (e.g., “Delete” instead of just “OK”)
Indicate a modal has opened
• Use visual cues like dimmed backgrounds or overlays
• Set focus on the first interactive element (e.g., the modal’s close button or first input)
• Visually and programmatically (with aria-modal="true" or aria-hidden="true") disable interaction with page content behind the modal
• Avoid scroll bleed (disable background scrolling while modal is active).
Provide close mechanism
• Include a visible "Close" button.
• Ensure the close control is keyboard-accessible (Tab, Enter, Esc)
• Label icon-only buttons with aria-label or title
Focus
• Use a focus trap to prevent users from tabbing to elements outside the modal
• Support both forward (Tab) and reverse (Shift+Tab) navigation
• After closing the modal, return focus to the element that triggered it (e.g., a button).
Ensure Keyboard Accessibility
• All modal interactions should be possible via keyboard
• Pressing Esc should close the modal (unless modal is critical and requires a decision)
Use Proper ARIA Roles and Attributes
• Use role="dialog" or role="alertdialog
• Label the modal with aria-labelledby or aria-label
• Use aria-describedby for supporting descriptions, if needed
Support Screen Readers
• Modal should be announced properly upon opening
• Ensure semantic HTML structure inside the modal (e.g., headings, landmarks)
A popover dialog is a small, non-blocking UI element that appears near a triggering element to provide additional information or options without interrupting the user's flow. Unlike a modal, which typically requires the user to interact with it to close before returning to the page, a popover is less intrusive and can be dismissed by clicking outside or interacting with its content.
Common search terms: Dialog, Popover, Popup