Skip to content

Toast message

Edit on GitHub
@volvo-cars/css v2.3.0@volvo-cars/react-messages v0.4.0

A toast message is a brief, temporary notification that confirms an action or process that the user just performed.

Toast message anatomy

  1. Container
  2. Icon
  3. Message
  4. Link
  5. Close button

Use toast message to provide users with immediate, non-critical feedback about actions or processes without disrupting their workflow.

Toast message example showing an item removed

Example showing a toast message that indicates an item has been removed.

  • Don’t use toast message for critical information or actions that require user input. Instead, use a modal dialog that requires immediate user action.
  • Do replace existing toast message with newer ones.
  • Display only one toast message on screen at a time. Toast messages do not stack.
  • If there is an action it should be somewhere else on the page as well.
  • Do not use auto-hide duration when an action button is present. For this case always display the ‘X’ button to give users control over dismissing or acting on the message.
  • The ‘X’ button is optional for toast messages without actions. It can be used alongside auto-hide duration to improve component usability.

Neutral toast messages display general status updates and informational messages.

Neutral toast message variant

Positive toast messages display successful actions, such as when a file has uploaded or a transaction has completed.

Positive toast message variant

Negative toast messages display alerts or indicate when errors occur.

Negative toast message variant

Toast messages appear top or bottom center on all screen sizes. Bottom placement is the default. Toast message default bottom placement

Bottom placement.

When bottom navigation is present, the toast message displays above the navigation.

Toast message displayed above bottom navigation

When a floating button is present, the preferred placement of a toast message is below.

Toast message displayed below a floating button

  • Don’t customize the placement of the toast message.
  • Avoid placing toast message over navigation elements or floating buttons.

Toast message is set to use light mode in both dark and light mode.

Toast message in light mode

Displaying toast message in light mode.

Toast message in dark mode

Displaying toast message in dark mode.

Toast width is determined by its content — longer messages result in a wider component. When an action is included, it always appears on a separate line below the message. Keep the body text to a maximum of two lines.

Toast messages have a maximum width of 45ch. On smaller devices, the toast message uses the full width minus the page margins.

We maintain a 24px spacing between the toast message and any persistent element. If there’s no element below, the toast message is positioned 24px from the bottom of the screen.

Toast message spacing with no elements below

Shows spacing when there are no elements below the toast message.

Toast message spacing with navigation bar below

Shows spacing with a navigation bar below the toast message.

Keep toast message text as short as possible, with no more than two lines in English, and use generic language for items.

Toast messages slide up from the bottom when users trigger an action and automatically hide after a brief period.

When automatic hide is enabled, the toast message slides out.

Toast message auto-hide animation

When a user triggers an action or close, the toast fades out.

Toast message hide by interaction animation

Toast messages with important actions can be customized to disable auto-hide, adjust display duration, or dismiss when users interact with them.

  • Avoid triggering toast messages too frequently. Repeated interruptions can be disruptive for users with cognitive and visual impairments.
  • Toast messages can be disruptive for users with cognitive and visual impairments. Intentional keyboard interaction and correct reading order are preferred.
  • Give users enough time to read when an action button is present. If the action button must be used, the message must be clear and precise.
  • Toasts should not automatically dismiss when an action is present; instead, ensure users can dismiss them manually (e.g., via the close button).

Neutral toast message when an item has been added

Displaying a neutral toast message when an item has been added.

Positive toast message when a transaction has been completed

Displaying a positive toast message when a transaction has been completed.

Positive toast message when an item has been removed

Displaying a positive toast message when an item has been removed.

Enterprise neutral toast message

Displaying a neutral message.

Enterprise positive toast message with overflow

Displaying a positive message with overflow.

Enterprise negative toast message without link

Displaying a negative message without link.