Modal guidelines
A modal says “pay attention to me and nothing else.”
A modal title should be one line
A modal title should be one line
The modal body will automatically scroll if the content gets too tall. Try to keep this from happening by keeping your content short and to the point.
The header sets the context
Short and sentence-case, the header should indicate what the modal is about.
The body is for a single task
This task should not require a lot of explanation or user interaction.
Buttons are right-aligned
The primary action is a filled button, and the secondary action is a link button. Labels should use strong action verbs.
Use a modal to silo a single action
A modal can gather input necessary for continuing the current workflow. This type of modal works best for a short, focused task. Use input modals sparingly—they interrupt the user's workflow.
Open a modal on a user action
Let a user action, such as a button click, open a modal. Don't open a modal from a toolbar action—users don't expect it.
Avoid scrolling content
Modal content should fit in a single view. If your modal has a lot of detail or a long list of items, consider a different solution, such as a form or a table.
Don't stack modals
Opening a modal on top of a modal might mean your workflow is too complex. Instead, use a component that supports multiple steps, such as a form or steps.
Use a modal to ask users to confirm an action
The most common use of modals in the EUI Framework is to confirm a user action. This modal should start with a question, give users enough information to make a decision, and restate the action in the button label.
State the action in both the header and button text
If the modal header is "Refresh this field?" then the button text should be "Refresh."
Create separate confirmations for single and bulk actions
It avoids the awkwardness of "Delete 1 pipeline(s)" and improves readability.'
Sometimes a header and buttons are enough
You can omit the body if users understand the decision from the header and button text alone.