Skip to main content

Toast

A toast notification is a brief, non-intrusive message that appears on the screen to provide users with information or alerts.

Dos and Don'ts

Do
  • Display only one toast at a time.
  • Limit your message to 35 characters for a single-line toast or 90 characters for a multi-line toast.
  • Be mindful of how often you trigger toasts.
  • Use for short messages that confirm an action taken by a user.
Don't
  • Don’t interrupt the user experience.
  • Don't use toasts for critical information.
  • Don't place the toast over any navigational elements.
  • Don’t use Toast for error messages. See Error patterns docs for alternatives.
  • Don’t overload with information, keep the messaging focused.


Anatomy

Anatomy of a toast.
  1. Icon: Leading icon that visually supports the label.
  2. Message: Informs the user of the action they have performed.
  3. Action (optional): Button action to either dismiss the toast or to undo the action.
  4. Close (optional): Icon button to close the Toast.

Variants

Default

A default single-line toast; this can be used with or without an icon or action.

A toast component on its default variation.

Multi-line

If you require additional text for your message, please use the multi-line component. Maximum of 3 lines.

A toast component with multiple lines of text. The text is truncated so that a maximum of three lines are shown.

Modifiers

Strong

Use strong colour variants to increase the visual impact of your message.

The info, warning, success and error toast variants with the strong modifier applied.
  1. Info: Providing contextual information about the progress of an action.
  2. Warning: Providing non-critical information about the progress of an action.
  3. Success: Providing positive information about the progress of an action.
  4. Error: Providing critical information about the progress of an action. Please review if toast is the correct component to use. It may be better to use a dialogue, notification or banner.

Subtle

To create a message with less prominence you can use the subtle variant.

Multiple toasts with the subtle modifier.
  1. Info: Providing contextual information about the progress of an action.
  2. Warning: Providing non-critical information about the progress of an action.
  3. Success: Providing positive information about the progress of an action.
  4. Error: Providing critical information about the progress of an action. Please review if toast is the correct component to use. It may be better to use a dialogue, notification or banner.
  5. Neutral: Neutral: Providing non-urgent general information about the progress of an action.

Icons

When using an icon inside the toast component, you should make sure that the icon clearly conveys the intended meaning. Only use the icons that have been built into the component - do not supply your own.

Do
Two toast components using approved icons for the error and info states.
Don't
An error toast using an unapproved icon

Actions

If you are using actions, only use the pre-built button in the toast.

Do
Two toast components with close icon button and dismiss button
Don't
A toast incorrectly using a custom dismiss button.


Sizes

Height

The toast has a minimum height of 48px when displaying one line of text. It should not exceed 122px in height, which is enough to accommodate up to three lines of text.

A regular toast and a multi-line toast.

Width

The toast has a minimum width of 300px and a maximum width of 720px.

Example of the toast component taking 90% of a screen with 360px width.
Example of the toast component in a 1024px screen with a maximum width of 720px.

Overflow

If the body copy extends beyond one line, it should automatically wrap to multiple lines. Multi-line text will be truncated so that it does not exceed three lines. For longer text content, consider an alternative component.

A regular toast and a multi-line toast.

Priority queue

Only one toast is displayed at a time. When toasts are consecutively or simultaneously triggered, their display order is defined by the priority queue.

Below it’s a reference for how a priority queue could be implemented by pillar engineers. Each level of priority takes over those below it, queues alongside toasts of the same priority, and yields to higher priority levels.

This is the suggested pattern for development, this functionality, if required is handled by pillar engineers.
PriorityVariant
1Error - actionable
2Error
3Warning - actionable
4Success - actionable
5Info - actionable
6Neutral - actionable
7Warning
8Success
9Info
10Neutral

Behaviours

Auto-dismiss

By default the toast automatically disappears after 5 seconds. However, the user can manually dismiss the toast before the timer ends if a close option is present. Additionally, users can pause the auto-dismissal by hovering over the toast, with the timer resetting once the mouse moves away.

A toast without a close icon button nor a dismiss button.
A toast with a close icon button.
A toast with an action dismiss button.
A toast with an icon and action dismiss button.

Persistent

If the toast has a close icon button or a dismiss button, the toast can be persisted until the user manually dismisses it.

A toast with a close icon button.
A toast with a dismiss button.

Interactions

If the toast includes either a close icon button or a dismiss button, either can be used to dismiss the toast.

Touch area

ElementPlatformTouch area
Close buttonAndroid48px x 48px
Action buttonAndroid[width of button] x 48dp
Close buttoniOS44px x 44px
Action buttoniOS[width of button] x 44px
“Dp” in Android stands for “Density-independent Pixel”. A scaling measurement system used to maintain consistent sizing across a variety of screen densities.
A toast with a close icon button.
A toast with a dismiss button.
  1. Close icon button: Target area to close the toast by clicking on the close button.
  2. Action button: Target area that leads to an action configuration which consequently dismisses the toast.

Layout

Content area

The content area is determined by the fixed content on the screen, such as Navigation Menu and Home Indicator Bar.

Full screen

A toast placed at the bottom-left of a page with a left-to-right direction.
  1. Full screen content area.

Docked bottom navigation

A toast placed at the bottom of a page with a docked bottom navigation.
  1. Content area in relation to the docked bottom navigation.

Floating bottom navigation

Content area for placing A toast placed above a floating bottom navigation.
  1. Content area in relation to the floating bottom navigation.

Home indicator

A toast placed above the home indicator.
  1. Content area in relation to the home indicator.

Positioning

The toast should always be positioned at the bottom centre of the mobile and tablet screens and to avoid the bottom navigation bar and a pinned footer. The bottom of the toast should be 24px from the base of the content area.

No fixed content

A toast placed at the bottom of a page with no fixed content.
  1. 24px from the base of the toast.

Bottom navigation

A toast placed at the bottom of a page with a bottom navigation.
  1. 24px from the base of the bottom navigation.

Floating navigation

A toast placed at the bottom of a page with a floating bottom navigation.
  1. 24px from the base of the toast in relation to the floating navigation.

Home indicator

A toast placed at the bottom of a page with a home indicator.
  1. 24px from the base of the toast in relation to the home indicator.

Examples

LTR examples

Here are some examples of the toast component in a left-to-right context:

A toast component in a left-to-right context.

RTL examples

Here are some examples of the toast component in a right-to-left context:

A toast component in a right-to-left context.
Back to top