Skip to main content

Display important messages and notifications. Supports multiple variants with icons and full RTL support.

Preview

Installation

Usage

Examples

Default

tsx

Destructive

tsx

Success

tsx

Warning

tsx

Without Icon

tsx

Props

NameTypeDefaultDescription
variant
"default" | "destructive" | "success" | "warning""default"Visual style variant of the alert

Accessibility

ARIA Roles

The Alert component uses role="alert" to announce important messages to screen readers.

Semantic HTML

Uses semantic heading elements for titles to maintain proper document structure.

Color Independence

Icons and text provide information redundancy, not relying solely on color.

RTL Considerations

The Alert component is fully RTL-compatible using logical properties.

LTR (English)

RTL (العربية)

Use Cases

System status messages

Form validation summaries

Feature announcements

Important notices that persist

Best Practices

Do

  • Use appropriate variants (info, success, warning, destructive)
  • Keep alert text concise and actionable
  • Include a dismiss option for non-critical alerts

Don't

  • Don't use for transient messages — use Toast instead
  • Don't stack too many alerts on one page
  • Don't use destructive variant for non-critical information

Related Components