Toast
A non-intrusive notification that appears temporarily. Powered by Sonner. The <Toaster /> component must be placed in your root layout.
Trigger Toasts
import { toast } from "sonner"
toast("Event has been created")
toast.success("Profile saved successfully")
toast.error("Something went wrong")
toast.warning("Please review your input")API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
toast(message) | function | — | Shows a default toast notification with the given message string. |
toast.success(message) | function | — | Shows a success toast with a green check icon. |
toast.error(message) | function | — | Shows an error toast with a red icon. |
toast.warning(message) | function | — | Shows a warning toast with a yellow icon. |
description | string | — | Optional description passed as second argument options: toast('Title', { description: '...' }). |