Dialogs

Dialogs provide users with contextual information or a prompt to take action.


Examples

An example of different types of dialogs. It shows alert, popconfirm and modal components.

Alert

An alert shows warnings, critical errors, success messages or other important information to users.

A design example of alert with text areas for title, message, confirmation and cancel buttons.


When to use

To alert users about task-related information and make decisions.

When not to use

  • For showing complex information.
  • For decorative purposes.
  • For trivial messages which do not require immediate attention.

Best practice


Purposeful

Prioritise critical alerts and avoid distracting users with less important messages.

A design example of how critical alerts are prioritised.

Responsive

An alert must adapt to different screen sizes and devices to be readable and useable.

A design example of responsive alert which can be adapted to various devices and screens.

Communicate consistently

Match the sentiment of the alert with its appropriate colour.

A design example of sentiment and colour to be used for alert. Grey indicates neutral, green indicates positive, blue indicates information, orange indicates warning and red indicates negative.

Actionable

Explain the purpose of the alert and write clear instructions so that users understand how to resume their workflow.

A design example of alert with a clear headline and message describing missing information.

A modal overlays a page and focuses user attention on a task or information.

A design example of a modal which allows users to send an email.


When to use

  • To display supplementary information.
  • To collect specific user input e.g., confirmation dialogs for deleting or completing a task.
  • To guide users through sequences in tasks.

When not to use

  • For presenting information that doesn't require immediate attention.
  • Don’t use more than one modal at a time.
  • Avoid using multiple modals in quick succession.

Best practice


Clear exit option

Provide a prominent close button or an overlay area outside the modal that allows users to click or tap to close the modal.

A design example of modal having a clearly placed close button.

Communicate with purpose

Write concise and consistent titles, labels and descriptions. Button labels should be a single, precise action word.

A design example of modal having clear titles, labels, descriptions and buttons.

Avoid lengthy content

Use an expandable panel or a page to avoid overwhelming users with excessive text or too many options.


Prominent and clear placement

Place modals in a prominent location so that users notice them. Typically, this would be top-centre.


Avoid overuse

Limit the number of modal notifications throughout as they can disrupt the user flow.

A design example of a modal being overused and disrupting user flow.

Cancellation

When seeking user confirmation for critical actions, include a secondary confirmation step to prevent accidental actions.

A design example of a modal asking for user confirmation before performing any major action.

Popconfirm

A popconfirm prompts users to confirm or cancel an action.

A design example of popconfirm which checks with users about deleting a task using Cancel or Delete buttons.


When to use

To confirm a user’s action e.g., deleting a file.

When not to use

  • For common actions that do not have significant consequences or are easily undone.
  • If the consequences of an action can be understood through labels or tooltips.

Best practice


Clear option to exit

Include a ‘Cancel’ or a ‘Close’ button so that users can change their minds and close the popconfirm.

A design example of popconfirm with a secondary button for closure.

Communicate clearly

Content in popconfirm should clearly state the action the user is about to perform and the potential consequences.

A design example of popconfirm which confirms with the user before they delete something.

Be specific

Label buttons with actions, e.g. ’Delete’ and ‘Cancel’ and avoid vague words such as ‘OK’ or ‘Continue’.

A design example of popconfirm with specific button labels for actions.

Maintain style

Design popconfirm using a consistent style to help users easily recognise them.

A design example of popconfirm with a consistent design style.

Accessibility

Shell DS components are programmatically determinable with appropriate semantic markup and are designed to meet colour contrast requirements. If you’re not using Shell DS code, you will need to cover the accessibility considerations for each component in this pattern.

Keyboard navigation

Tab

The focus moves to the next interactive element within the dialog.

Shift + Tab

The focus moves to the previous interactive element within the dialog.

Enter or Space

Triggers the focused element to starting action

Escape

Closes the dialog.


Is this page useful for you?

Your feedback helps to improve our documentation.