Skip to main content
React hook that provides access to the toast notification system. Built on top of Sonner for displaying temporary toast messages.

Signature

Returns

Returns the toast function from Sonner with all its methods:
function
Main toast function for displaying messages

Usage

Basic Toast

Success Toast

Error Toast

Loading Toast

Promise Toast

Toast with Description

Toast with Action

Dismissing Toasts

Toast Options

All toast methods accept an optional options object:

Example: Form Submission

Best Practices

  1. Keep messages concise: Toast messages should be brief and scannable
  2. Use appropriate variants: Choose the right variant (success, error, warning) for the context
  3. Provide actionable feedback: Include action buttons when users can respond (e.g., “Undo”)
  4. Don’t overuse: Avoid showing multiple toasts simultaneously for unrelated actions
  5. Set appropriate duration: Longer messages may need longer display time
For more advanced usage and customization options, refer to the Sonner documentation.