Toasts can educate people on the content of the screen, provide confirmation when people complete an action, or simply communicate a short message.

Toast is purely visual. In order to properly handle the showing and dismissing of Toasts, as well as any animations, you will need to implement a Toast manager.

Props

Component props
Name
Type
Default
text
Required
string | Element<*>
-

Use string for guide toasts (one line of text) and React.Node for confirmation toasts (complex text, potentially containing a Link). Do not specify a Text color within this property, as the color is automatically determined based on the variant.

button
React.Node
-

Add an optional button for user interaction. Generally not recommended given the ephemeral nature of Toasts.

thumbnail
React.Node
-

An optional thumbnail image to displayed next to the text.

thumbnailShape
"circle" | "rectangle" | "square"
"square"

The masked shape of the thumbnail.

variant
"default" | "error"
"default"

Use the 'error' variant to indicate an error message. Generally not recommended given the ephemeral nature of Toasts.

Usage guidelines

When to use
  • Displaying non-critical feedback on the result of an action.
  • Reinforcing success at the surface level.
When not to use
  • Providing an update related to anything other than confirmation of a successful action. Consider a Callout instead.
  • Presenting mandatory and/or critical actions to a user.
  • Displaying feedback at the element level (e.g., entered password doesn't meet requirements). Use inline text instead.

Example: How to display

Toasts should be displayed in the center of the viewport, opposite the main navbar (e.g. at the top of the viewport on mobile, bottom of the viewport on desktop). Though not implemented here, Toasts are meant to be ephemeral and disappear after a few seconds.

Example: Simple Text

Example: Complex Text

When passing in your own Text component for text, do not specify color on Text. Toast will automatically pick the correct text color for the given variant.

Example: Error variant

Example: Image + Text

Example: Image + Text + Button

Combinations: Overview

Section created!
Section created!
Modern ceramic vase pin.
Section created!
Modern ceramic vase pin.
Section created!
Saved to Home decor
Saved to Home decor
Modern ceramic vase pin.
Saved to Home decor
Modern ceramic vase pin.
Saved to Home decor

Combinations: Thumbnail shapes

Blush and sage plant print.
Saved to Home decor
Blush and sage plant print.
Saved to Home decor
Blush and sage plant print.
Saved to Home decor