Toast

Generates toast notifications.

API Reference

Installation

Add the ToastProvider and AnchoredToastProvider to your app.

app/layout.tsx

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:

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):

Examples

With Status

Loading

With Action

Promise

With Varying Heights

Copy Button with Anchored Toast

Submit Button with Error Toast