Alert
Feedbackv1.0.0
stable
Alert component for notifications with multiple variants and auto-dismiss.
Variants
Alert Title
This is an alert message.
variant="primary"
primary
Alert Title
This is an alert message.
variant="info"
info
Alert Title
This is an alert message.
variant="success"
success
Alert Title
This is an alert message.
variant="warning"
warning
Alert Title
This is an alert message.
variant="destructive"
destructive
npx inam-ui add alertUsage Examples
Success Alert
Show a success message
<Alert
variant="success"
title="Success"
description="Your changes have been saved."
/>Auto-dismiss
Alert that auto-closes after 3 seconds
<Alert
variant="info"
title="Tip"
description="This will auto-close in 3 seconds"
autoClose={3000}
/>Accessibility
ARIA Labels
role='alert'
Screen Reader
Alerts are announced immediately when they appear.
Props
| Name | Type | Default | Description |
|---|---|---|---|
variant | 'primary' | 'info' | 'success' | 'warning' | 'destructive' | 'primary' | Visual style of the alert. |
title | string | — | Title text for the alert. |
description | string | — | Description/message text. |
closable | boolean | true | Whether the alert can be dismissed. |
autoClose | number | 0 | Auto-dismiss timeout in milliseconds (0 = no auto-dismiss). |
onClose | () => void | — | Callback when alert is closed. |