Toast

Global notification system for system events and user feedback, powered by Sonner.

Preview & Interactive Laboratory

Semantic Indicators
Complex Interactivity

Actionable Toast

Promise Resolution

Custom Content

Usage & Implementation

import { toast } from "sonner"

// Basic
toast("Message")

// Status
toast.success("Completed")
toast.error("Failed")

// With Action
toast("Verify Account", {
  action: { label: "Verify", onClick: () => console.log("Verified") }
})
React / Tailwind

Granular Customization

1

Global Config

Set position and styling in the root layout.

className={`Toaster position='top-right'`}
2

Theme

Adapts to light/dark modes automatically.

className={`richColors closeButton`}
3

Custom Style

Override variables for premium glass looks.

className={`glass shadow-xl shadow-primary/5`}

API Reference (Props)

PropTypeDefaultDescription
descriptionstring-Secondary text below the title.
actionobject-Action button with label and onClick.
durationnumber4000Visibility time in ms.
promisefunction-Handle async states automatically.