Sonner Interactive 5 component design & features
This sonner example uses the shadcn Sonner component with toast.dismiss. One control removes a toast by the id returned from toast, and another clears every visible toast.
Programmatic dismiss belongs in flows that show a toast and later remove it from code, such as closing a panel, finishing a wizard, or cancelling an in-progress action.
