Skip to main content

Installation

Setup

Add the Toaster component to your app:

Usage

Component API

Toaster

Global toast container component.

toast Function

The toast function is the main API for showing toasts. Basic:
With Description:
Types:

Examples

Basic Toast

Toast Types

Different toast types:

With Description

Toast with additional description:

With Action

Toast with action button:

Promise Toast

Show toast for async operations:

Custom Duration

Position

Change toast position:

Rich Content

Toast with custom JSX:

Dismissible

Control dismissibility:

Form Submission

Practical example with form:

Delete Confirmation

Update Toast

Update an existing toast:

Customization

The component includes custom icons and theming:

API Reference

For complete API documentation, see Sonner documentation.

Credits

Sonner is built and maintained by Emil Kowalski.