Render Flow - Modal and overlay patterns
User clicks button
Show overlay element
Show modal box on top
Trap keyboard focus inside modal
User interacts or closes modal
Hide modal and overlay
The browser first shows a semi-transparent overlay covering the page, then displays the modal box above it. Keyboard focus is trapped inside the modal to keep interaction contained. Closing the modal removes these elements.