Recall & Review
beginner
What is a modal in web design?
A modal is a popup window that appears on top of the main page content. It grabs the user's attention and requires interaction before returning to the main page.
Click to reveal answer
beginner
Why do we use overlays behind modals?
Overlays dim or blur the background content to focus the user's attention on the modal. They also prevent interaction with the page behind the modal.
Click to reveal answer
intermediate
How can you make a modal accessible for keyboard users?
Ensure the modal traps keyboard focus inside it, so users can tab only within the modal. Also, provide a clear way to close the modal using keyboard keys like Escape.
Click to reveal answer
beginner
Which Tailwind CSS utilities help center a modal on the screen?
Use
fixed to position the modal, inset-0 to cover the screen, and flex with items-center and justify-center to center the modal content.Click to reveal answer
intermediate
What is the role of
aria-modal and role="dialog" in modals?aria-modal="true" tells assistive technologies that the rest of the page is inert while the modal is open. role="dialog" identifies the modal as a dialog window for screen readers.Click to reveal answer
What does an overlay behind a modal usually do?
✗ Incorrect
An overlay dims the background and prevents users from interacting with the page behind the modal.
Which Tailwind class helps fix a modal to the viewport?
✗ Incorrect
The
fixed class positions the modal relative to the viewport, keeping it visible when scrolling.How should keyboard focus behave when a modal is open?
✗ Incorrect
Focus trapping keeps keyboard users inside the modal until it is closed, improving accessibility.
Which ARIA attribute indicates a modal dialog?
✗ Incorrect
aria-modal="true" signals that the modal is active and the rest of the page is inert.What Tailwind classes center content both vertically and horizontally?
✗ Incorrect
Using
flex with items-center and justify-center centers content in both directions.Explain how to create an accessible modal using Tailwind CSS.
Think about layout, accessibility, and user interaction.
You got /5 concepts.
Describe why overlays are important in modal patterns and how Tailwind helps implement them.
Consider visual focus and interaction blocking.
You got /4 concepts.