The Modal Overlay pattern provides a way to quickly load and display important information to the user without navigating away from the current page. Use cases for Modal Overlays can vary a great deal, but some examples include the following:
- To collect data from users
- To remind or prompt users
- To load dialogs that require user input before advancing
- To load tasks which require a user’s full attention, such as stepping through a wizard flow
- To present important information or warnings
For specialized examples of the Modal Overlay, jump to the Wizard or the About Modal patterns. For use cases that do not require a user’s full attention, consider using the Modeless Overlay pattern. With the Modeless Overlay, the background is still accessible so users can interact with the rest of the page.
Modal Overlay Example
Title (Optional): There should be a title bar spanning the top of the modal with a title in the top left corner. The title should be descriptive enough to convey the purpose of the modal while remaining concise. The title may match the action button or link that prompted the overlay modal to appear.
Close: The pficon-close icon should always be available in the top right corner to close the modal overlay.
- The panel should be animated to transition down from the top of the page
- The panel should sit below the masthead
- The panel should be centered with a maximum width
- The panel height can vary depending on the content
- There should be at least 20px of padding on the right and left side of the panel
- There should be at least 50px of padding on the bottom of the panel
- The panel should have a scroll bar if scrolling is needed to display all of the content
Buttons: Action buttons should be right aligned with the primary action as the right most button.
- Background: When the modal overlay appears, the background should darken to bring attention to the primary content. While the rest of the page is no longer accessible, the background should still be legible to remain in context for the user.