Alert Notification
A versatile alert and notification system that provides toast notifications, alert dialogs, and simple alert/confirm functions.
Basic Usage
A simple alert notification that shows a message with a title, type, and duration.
Alert Types
The Alert Notification system supports different types of alerts to match various scenarios.
Alert Dialog
For alerts that require immediate attention or confirmation, you can use the AlertDialog component.
Props
Available props for the Alert Notification component.
Alert
titlestring''Title of the alert
messagestring | ReactNode''Message content of the alert
type'success' | 'error' | 'info''info'Type of alert which determines the styling and icon
durationnumber5000Duration in milliseconds before auto-hiding (0 for no auto-hide)
onConfirmFunctionnullCallback function for confirm button
confirmTextstring'OK'Text for confirm button
onCancelFunctionnullCallback function for cancel button
cancelTextstring'Cancel'Text for cancel button
classNamestring''Additional CSS classes to apply to the alert
position'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center''top-right'Position of the alert on the screen