Explore various notification types and how to implement them for effective user communication.
Used to confirm a successful action or process. It's clear, positive, and reassuring.
showNotification('Success!', 'Your operation was completed successfully.', 'success');
Informs the user about an issue or failure. It should clearly state the problem and suggest a resolution if possible.
showNotification('Error!', 'An unexpected error occurred. Please try again.', 'error');
Alerts the user to a potential problem or something that requires their attention but isn't an immediate error.
showNotification('Warning!', 'Your session is about to expire. Please save your work.', 'warning');
Provides general information or updates to the user without indicating success, error, or warning.
showNotification('Info', 'A new version of the application is available.', 'info');
Notifications that remain visible until explicitly dismissed by the user, useful for critical alerts.
showPersistentNotification('System Alert', 'Server maintenance scheduled for tonight. All services will be temporarily unavailable.', 'info');
Allow users to take immediate action directly from the notification itself.
showNotificationWithAction('New Message', 'You have a new message from John Doe.', 'primary', 'Reply', () => alert('Reply action triggered!'));