Toaster

Transient notifications, stacked in a corner.

// Once, near the root of the app
<Toaster />
 
// Anywhere
toast.success("Booking confirmed");

Re-exported from Sonner with the kit's tokens applied, so toast, toast.success, toast.error, toast.promise and the rest behave as documented there.

API

PropTypeDefault
classNamestring—
closeButtonboolean—
containerAriaLabelstring—
customAriaLabelstring—
dir"auto" | "ltr" | "rtl"—
durationnumber—
expandboolean—
gapnumber—
hotkeystring[]—
iconsToastIcons—
idstring—
invertboolean—
mobileOffsetOffset—
offsetOffset—
positionPosition—
richColorsboolean—
styleCSSProperties—
swipeDirectionsSwipeDirection[]—
theme"dark" | "light" | "system"—
toastOptionsToastOptions—
visibleToastsnumber—

Plus the DOM props of the element it renders. Source: sonner/components/sonner.tsx.