Workday Canvas

Alert Dialog

The Alert Dialog is a modal window that blocks content, providing critical information that requires a decision.

Sources
Figma

Alert Dialog vs. Modal

The Alert Dialog component is the mobile equivalent of Modal for web. Both components popup over existing content and are accompanied by an overlay.

Anatomy

The basic elements of an alert dialog

  1. Overlay: Scrim for added emphasis.
  2. Message Container: Contains all the elements of the Alert Dialog.
  3. Title (Optional): Header text.
  4. Message: A concise message no longer than 4 lines.
  5. Buttons: Actions related to the message.

Usage Guidance

Alert Dialogs are reserved for messages of the highest priority due to their blocking behavior. Disabling a user’s task while providing information without an actionable outcome may lead to frustration.

When to Use

  • To communicate critical information that requires user decision or action.

When to Consider Something Else

  • Avoid an Alert Dialog for low or medium priority messaging. The Alert Dialog disables all functionality until action has been taken, distracting a user from their task at hand.
  • Consider using Banners if communicating errors or warnings about a task. Please note that Banners do not disappear unless the user resolves the required action.
  • Consider using Snackbars when communicating updates about a process. Snackbars do not require user action.
  • When no content can display on a page (due to a server error or connectivity issue, for example), use an Empty State, use the full page to communicate the status of the feature or to help educate users about its purpose. Empty states should include a message.

Behaviors

Alert Dialogs block content ― providing critical information and requiring a decision ― by appearing above screen UI elements and disabling all functionality until action has been taken.

Examples

Padding

Left and right margins vary across device types.

Left and right padding for an alert dialog

Action Styling

The Alert Dialog supports 1 or 2 actions. When there are 2 horizontal action buttons, the primary button should always be on the right.

Alert dialog with 1 primary button

Alert dialog with 2 horizontally aligned buttons

If button labeling breaks the built in padding requirements for horizontal alignment (e.g., buttons with long labels or with internationalization issues), use stacked buttons instead.

Alert dialog with 2 vertically stacked buttons

Titling

Titles are optional but recommended to increase clarity. Titles should contain a brief and clear statement but may extend to 2 lines if needed.

Alert dialog with short and concise title.

Do

Use titles that are short and concise, explain the request, and give clear actions.

Alert Dialog with a title that poses a question.

Don't

Use titles that ask a question or make it unclear how to proceed.

API Guidelines

Methods

Class name: AlertUIComponent Module name: UIComponentsPlugin

public init( featureData: FeatureMetricsData, title: String, message: String? = nil, show: Binding<Bool>, mainButtonType: AlertMainButtonType, mainButtonConfig: AlertButtonConfig? = nil, auxiliaryButtonConfig: AlertButtonConfig? = nil )

Parameters

NameDescriptionDefault values
featureDatathe feature name/context and the screen ID in which the component appears.
titleTitle of the alert, displayed on top. Needs to be passed after localization.
messageMessage of the alert, displayed below the title. Needs to be passed after localization.nil
showBoolean binding that controls the visibility of the component.
mainButtonTypeAlertMainButtonType representing the type of the main button.
mainButtonConfigOptional AlertButtonConfig having the information to display an action button. If a value is not provided, we will render a primary button with a title of “Ok” if the mainButtonType is primary/secondary and a delete button with a title of “Delete” if the mainButtonType is delete.nil
auxiliaryButtonConfigOptional AlertButtonConfig having the information to display an additional action button. If a value is not provided, we will render a secondary button with a title of “Cancel”.nil

Accessibility Guidelines

Coming soon…

Content Guidelines

  • In titles, avoid apologies (i.e., sorry, please, etc…), or additional written level of emphasis (e.g., warning).
  • See Popups, Modals, and Dialogs in the UI Text Section of Content Style Guide for additional Alert Dialog language guidelines.

Can't Find What You Need?

Check out our FAQ section which may help you find the information you're looking for. For further information, contact the #ask-canvas-design or #ask-canvas-kitchannels on Slack.

On this Page: