Toast

A temporary notification that appears on screen to inform users.

Usage

Stacked Toasts

By default, toasts appear in the bottom-right corner. You can change this by setting the position prop on the ToastProvider.

Allowed values: top-left, top-center, top-right, bottom-left, bottom-center, bottom-right. For example:

Deduplicated toasts (upsert)

Pass a stable id when calling toastManager.add. If a toast with that id already exists, it is updated in place, the auto-dismiss timer is refreshed, and updateKey is incremented. The styled toast replays a short re-notify animation on each update.

Anchored Toasts

For toasts positioned relative to a specific element, use anchoredToastManager. The AnchoredToastProvider is typically added to your app layout (alongside ToastProvider), so you can use anchoredToastManager directly in your components:

You can also style anchored toasts like tooltips by passing data: { tooltipStyle: true }. When using tooltip style, only the title is displayed (description and other content are ignored):

API Reference

ToastProvider

Provider component for stacked toasts.

AnchoredToastProvider

Provider component for toasts anchored to specific elements. Use with anchoredToastManager.

toastManager

Manager object for creating stacked toasts. Use toastManager.add() to show a toast. Pass the same id on a later add to update that toast in place (dedupe) instead of stacking a duplicate.

anchoredToastManager

Manager object for creating anchored toasts. Use anchoredToastManager.add() with positionerProps.anchor to show a toast anchored to an element. Repeated add calls with the same id update in place, same as stacked toasts.

ToastViewport

Viewport container for toasts.

Toast

Individual toast container.

ToastTitle

Title text for the toast.

ToastDescription

Description text for the toast.

ToastAction

Action button for the toast.

ToastClose

Close button for the toast.

Examples

With Status

Loading

With Action

Promise

With Varying Heights

Copy Button with Anchored Toast

Submit Button with Error Toast