Sonner Interactive 8 - Toast lifecycle callbacks

Pro

Sonner toast with onDismiss and onAutoClose callbacks after the toast leaves.

Shadcn Sonner Interactive 8 component

Component data

ID
sonner/sonner-interactive-8
Access
pro
Created
Aug 19, 2026
Type
example
Libraries
Radix UI, Base UI, React Aria

Sonner Interactive 8 component design & features

This sonner example uses the shadcn Sonner component with onDismiss and onAutoClose. One callback runs when the user closes or swipes the toast, and the other runs when the duration expires.

Lifecycle callbacks belong in analytics, follow-up toasts, or cleanup after a notification leaves the screen.