Modal
Modals present content in a layer above the page. They are used for important alerts or interactions that require user attention.
USWDS modals are hidden until triggered by a button with data-open-modal. The USWDS JavaScript manages focus, the overlay, and aria-hidden on the rest of the page. Each example below opens its modal on activation.
Default Modal
Are you sure you want to continue?
This action cannot be undone. All data will be permanently deleted from the server. Please confirm you want to proceed.
Small Modal
Small modal
This is a smaller modal dialog with less content space.
Modal with Custom Footer
Custom footer modal
This modal has a custom footer with different button arrangements.
Activation Code
<button type="button" class="usa-button" aria-controls="demo-modal" data-open-modal
Open modal
Open modal demo
This modal can be opened with a button click and closed with the X button or pressing Escape.