- style
Toasts
Related pages: Message Popups
- 1 Description
- 2 Types
- 3 Usage & Behavior
- 3.1 General guidelines
- 3.1.1 Structure
- 3.1.2 Placement and Positioning
- 3.1.3 Interaction
- 3.1.4 Multiple Toasts
- 3.2 Best practices
- 3.1 General guidelines
- 4 Accessibility compliance
- 5 Design
- 6 Code
Description
A toast is a small message box that appears in response to a user action or system event. It contains simple feedback about the event, while any current activity remains visible and interactive.
Types
Type | Usage | Example |
---|---|---|
Information | General information related to an action. |
|
Success | Actions that were completed successfully. |
|
Warning | System warnings or actions that may cause a problem. |
|
Error | System errors or actions that have failed to complete. |
|
Continuous Action | An action that takes more than 3 seconds. |
|
Usage & Behavior
General guidelines
Toasts are triggered either by the user (e.g. refreshing a data table) or by the system (e.g. a server error).
Toasts appear from the bottom-left side of the screen using a slide effect.
Error toasts stay on the screen until the user actively closes them.
Other types of toast disappear automatically after a few seconds with a fade effect.
The user can always close a toast manually, even if it will automatically close.
Structure
A toast may consist of:
Either:
an icon representing the type of toast, such as a check mark or warning triangle, or
where there is a continuous action, an animated Progress Indicator.
Text, including:
a title (optional).
the message body.
A closing button (x).
A Cancel button, for continuous actions.
An expand button for longer messages (see Placement below).
Placement and Positioning
All toasts appear from the bottom-left side of the screen (using a slide effect).
Toasts have a fixed width.
The height of a toast depends on the amount of text it contains. Where there are more than 3 lines an expand button will appear, allowing the user to enlarge the toast.
|
|
Interaction
Mouseover a toast will keep it visible, even after exceeding the time limit before it disappears.
Clicking the closing button (x) closes the toast with a short fade effect.
When shown, clicking the Cancel button cancels the continuous action which has triggered the toast, and closes it. In this case, another information toast may appear, indicating that the action was canceled.
When shown, clicking the expand button:
expands the toast upwards with a slide effect, revealing the rest of the text.
hides the expand button.
pushes all other toasts upwards (see Multiple Toasts below).
Multiple Toasts
Where a new toast appears before a previous one has been closed, the page will show multiple toasts.
Condition | Behavior | Design |
---|---|---|
The new toast is not an error toast (i.e. info or success toasts etc.) | The new toast will appear on top, above all previous toasts. |
|
The new toast is the first error toast on the page. | The new toast will appear at the bottom, pushing all other toasts upwards. | |
The new toast is an additional error toast (there are other error toasts already on the page). | The new error toast will be stacked behind the existing error toasts. It should appear underneath and slightly above the previous error toasts, showing the first line of text. In this case:
|
|
Best practices
Use:
to display application-level messages, warnings, and errors.
when you need a relatively unobtrusive way to show messages, and to keep the rest of the page interactive.
Don’t use:
for critical messages → use Message Popups.
General
Keep the text short and informative.
For warning or error toasts, offer the user a way to recover.
Accessibility compliance
Unless otherwise specified, see our general compliance information in Fundamentals - Accessibility.
Design
Zeplin link | Screen thumbnail |
---|---|
|
Code