Alert

Alert banners for displaying informational, success, warning, and error messages. Each variant uses distinct color coding for quick visual identification.

Variants

Preview

Props

PropTypeDefaultDescription
variant"default" | "info" | "success" | "warning" | "destructive""default"Visual style variant of the alert.
titlestring-Bold title displayed at the top of the alert.
iconReactNode-Optional icon displayed on the left side of the alert.
classNamestring-Additional CSS classes.

Accessibility

  • Renders with role="alert" for screen reader announcements
  • The destructive variant uses aria-live="assertive" for immediate announcement
  • Other variants use aria-live="polite" for non-intrusive announcements
  • Supports ref forwarding for DOM access
  • Passes through all standard HTML attributes including aria-* and role