Use modal dialogs load and display important information without navigating away from the current page.
- Modal box
- Title: concisely convey the purpose of the modal.
- Content area
- Buttons: enable a user to confirm, submit, or exit. Modal dialogs can include multiple action buttons, but should be limited to one primary button
Use a modal dialog when information is critical and requires user input or attention. Use modals to:
- Validate user decisions
- Report errors
- Provide the result of a task or state of an application
- Get required user input
Modal dialogs interrupt user task flow and should be avoided for any information that is not critical to user success.
Use a confirmation dialog to validate user decisions and communicate consequences. Confirmation dialogs need to clearly restate the action the user is trying to take and explicitly outline the consequences of that action.
Note: Since confirmation dialogs disrupt user task flow, do not provide confirmation dialogs for actions that are easily reversed or insignificant.
Provide buttons on confirmation dialogs that make it simple for users to understand and confirm their choices. When choosing button labels, use descriptive verbs that clearly indicate the consequence of a selection, like Delete, Save, or Create. Avoid vague labels like OK or Done.
Ambiguous title and button labels make it more difficult for the user to understand their options and make a decision. Descriptive title and button labels make it easy for the user to scan the content and make a decision quickly.
If an action is difficult or impossible to undo, a warning icon can be incorporated into the modal to add emphasis. If an action will seriously impact the system and cannot be undone, use a destructive style button. Otherwise, use a primary button.
Sometimes it is necessary to require an additional confirmation with a destructive action. An example using a form field can be seen below. In order for the destructive action to become actionable, the user needs to type in a word or phrase to make the button active.
- What is the problem?
- Why did it happen?
- How can I fix it?
Never blame the user. Use passive voice where appropriate to avoid assigning blame.
- ⛔ You put in the wrong password.
- ✅ That password wasn’t recognized OR
- ✅ We didn’t recognize that password.
Use passive dialogs to communicate critical information like the status of an application or result of an action. The content of a passive dialog should be important, immediately relevant, and either lead to or require action on the user’s part.
Some usage examples include:
- Notifying a user that an operation may take a long time to complete
- Notifying a user that a critical process is complete
Note: If information is not critical, don’t use a passive dialog. Instead, use inline notifications or toast notifications.
Sometimes users may need to provide additional input in order to complete an action. In this situation a form or other type of element may be incorporated into the modal. An example of this use case is the modal wizard.
Clearly restate the action the user is trying to take and explicitly outline the consequences of that action.
Provide button labels that make it simple for users to understand and confirm their choices. Use descriptive verbs that clearly indicate the consequence of a selection, like Delete, Save, or Create. Avoid vague labels like OK or Done.
Use descriptive title and button labels so the user can scan content and make a decision quickly. Ambiguous title and button labels make it more difficult for the user to understand their options and make a decision.
If the modal needs to convey the importance of information visually, icons can be added.
See our content guidelines for additional guidance.
|Warning: Caution/ Warning||Use on confirmation dialogs or passive dialogs to indicate a higher level of urgency and importance.|
|Critical Warning: Information will be deleted/permanent action||Use on confirmation dialogs or passive dialogs to indicate the highest level of urgency and importance.|
|Error: Alert the user that there has been a critical failure/error||Use on error dialogs to indicate a problem.|
|Acknowledgement: Informs the user of an action or result||Use on confirmation or passive dialogs to indicate a lower level of urgency.|
The PatternFly components listed in the following sections can be used in a number of ways to suit specific needs or use-cases. We’ll explore several examples in this documentation.