Toast
A toast displays a short system message as a result of a user's action.
Structure
- Container: Wraps the content.
- Message: Text content indicating the purpose and potential next steps.
- Dismiss button: Removes the toast for a user.
Guidelines
When to use
- To display temporary short messages.
- To react to user input (let users know something is happening).
When not to use
- If the message should stay on the screen—use an Alert.
- When you want to include an action—use an Alert.
- When an action is necessary before continuing—use a Modal.
Variants
- Information
- Success
- Warning
- Error
Behaviour
A toast appears with an ease-in animation from the bottom of the viewport after a user's action.
A user can dismiss the toast by clicking the “dismiss” icon button. If left alone, a toast will disappear after five seconds.
Hovering over a toast causes it to remain until the cursor is moved.
Placement
Centered at the bottom of the viewport for smaller breakpoints and bottom left of the viewport for larger breakpoints.
Multiple toasts stack vertically from top to bottom with the oldest on top.
Content
The message should be concise, specific, and use clear language:
Examples of Toast Messages:
- Success Message:
- "Saved successfully."
- "Updated your profile."
- "Message sent!"
- Error Message:
- "Failed to save."
- "Network error."
- "Invalid email address."
- Informational Message:
- "New message received."
- "Reminder set."
- "Device connected."