Dismiss by ID
Signature
Parameters
The toast ID to dismiss
Example
Use case: Persistent toast with manual dismiss
Use case: Dismiss from custom content
Dismiss all
Signature
Example
Use case: Clear all on navigation
Use case: Clear on logout
Use case: Error boundary
Examples combining both
Dismiss old, show new
Batch operations
Conditional dismissal
Notes
toast.dismiss(id)triggers the exit animation before removing the toasttoast.dismissAll()dismisses all visible toasts immediately- Only
toast.custom()returns a toast ID - other toast methods (success, error, info, promise) do not return IDs - If you need to track and dismiss specific non-custom toasts, use the
idoption: - Dismissing a toast that doesn’t exist (or was already dismissed) is a no-op and won’t cause errors