Alert

Feedback
v1.0.0
stable

Alert component for notifications with multiple variants and auto-dismiss.

Variants

variant="primary"
primary
variant="info"
info
variant="success"
success
variant="warning"
warning
variant="destructive"
destructive
npx inam-ui add alert

Usage 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

NameTypeDefaultDescription
variant'primary' | 'info' | 'success' | 'warning' | 'destructive''primary'Visual style of the alert.
titlestringTitle text for the alert.
descriptionstringDescription/message text.
closablebooleantrueWhether the alert can be dismissed.
autoClosenumber0Auto-dismiss timeout in milliseconds (0 = no auto-dismiss).
onClose() => voidCallback when alert is closed.

Related Components