Components Alerts

Alerts

Contextual feedback messages for typical user actions with consistent styling and behavior.

Preview Mode WCAG AA Mobile Ready

Success Alerts

Use success alerts to confirm successful actions or completion of processes.

Error Alerts

Use error alerts to inform users about problems that require attention or action.

Warning Alerts

Use warning alerts to draw attention to important information that may require user consideration.

Info Alerts

Use info alerts to provide neutral information or helpful tips to users.

Compact Alerts

Smaller alerts for inline feedback and status messages.

Interactive Examples

Try these interactive alert demonstrations to see behavior in action.

Usage Guidelines

When to Use

  • Form submission feedback (success/error)
  • System status updates
  • Important notifications
  • Contextual help and tips

Best Practices

  • Use appropriate color coding
  • Include clear, actionable text
  • Provide dismissal options when appropriate
  • Auto-dismiss toasts after 3-5 seconds

Accessibility

All alerts are built with accessibility in mind and follow WCAG 2.1 AA guidelines.

Features

  • role="alert" for screen readers
  • Proper color contrast ratios
  • Keyboard navigation support
  • Focus management

Implementation

<div class="..." role="alert">
  <h3 id="alert-title">Title</h3>
  <p>Description</p>
  <button aria-label="Close alert">
    <span class="sr-only">Close</span>
    <!-- Icon -->
  </button>
</div>