0
0
Tailwindmarkup~5 mins

Modal and overlay patterns in Tailwind - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
ADim the background and block interaction
BMake the modal draggable
CAdd animations to the modal
DChange the page title
Which Tailwind class helps fix a modal to the viewport?
Astatic
Brelative
Cabsolute
Dfixed
How should keyboard focus behave when a modal is open?
AFocus should move freely around the page
BFocus should jump to the browser address bar
CFocus should be trapped inside the modal
DFocus should be disabled
Which ARIA attribute indicates a modal dialog?
Aaria-modal
Baria-hidden
Caria-label
Daria-live
What Tailwind classes center content both vertically and horizontally?
Ainline-block align-middle
Bflex items-center justify-center
Cgrid place-items-start
Dblock text-center
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.