Toast notifications using Sonner with pill shape and custom styling
duration: Infinitytoast()toast.success()toast.error()toast.warning()toast.info()toast.loading()action: { label, onClick }action: { label, onClick }action: { label, onClick }duration: 5000closeButton: truedescription: stringShow all toast types at once
{ type: "all" }Toast that tracks promise state
{ toast.promise: "Promise" }Toast appears at top-center (configured in Toaster)
{ position: "top-center" }Toast with longer text content
{ content: "long string" }Dismiss all active toasts
{ toast.dismiss(): "void" }Action button uses primary styling from Toaster config
{ actionButton: "styled" }The Toaster is configured in src/components/ui/sonner.tsx
// Toaster configuration
<Toaster
position="top-center"
richColors
expand={false}
toastOptions={{
classNames: {
toast: 'group toast group-[.toaster]:bg-white group-[.toaster]:rounded-full group-[.toaster]:shadow-lg',
actionButton: 'group-[.toast]:bg-primary group-[.toast]:text-primary-foreground group-[.toast]:rounded-xl',
},
}}
/>