Toast

A Toast component is a user interface element that provides brief, transient messages or notifications to the user.

Use Cases:

✅ Displaying success messages after a user successfully completes an action (e.g., "Your changes have been saved.")

✅ Showing error messages when a user encounters a problem (e.g., "An error occurred. Please try again.")

✅ Providing informative messages or notifications (e.g., "You have a new message.")

✅ Showing warning messages to alert users about potential issues (e.g., "Your password will expire in 3 days.")

Not to Use Cases:

❌ Displaying critical system errors that require immediate action (e.g., "Database connection failed. Please contact support immediately.") - Critical errors should be handled with a more prominent and comprehensive error handling system, not just a Toast component.

❌ Showing long or complex messages with detailed instructions or explanations - Toasts are typically used for short and concise messages, so it's not suitable for displaying lengthy content.

❌ Using Toasts for interactive components or forms that require user input - Toasts are meant for displaying messages and should not be used as a replacement for interactive UI elements like forms or modals.

Last updated