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

PropTypeDefaultDescription
toast(message)functionShows a default toast notification with the given message string.
toast.success(message)functionShows a success toast with a green check icon.
toast.error(message)functionShows an error toast with a red icon.
toast.warning(message)functionShows a warning toast with a yellow icon.
descriptionstringOptional description passed as second argument options: toast('Title', { description: '...' }).