Alerts
Contextual feedback messages for typical user actions with consistent styling and behavior.
Success Alerts
Use success alerts to confirm successful actions or completion of processes.
Successfully saved!
Your task has been created and assigned to the project.
Order completed
Lorem ipsum dolor sit amet consectetur adipisicing elit. Aliquid pariatur, ipsum similique veniam.
Error Alerts
Use error alerts to inform users about problems that require attention or action.
There was an error with your submission
Please check the following fields and try again:
- Email address is required
- Password must be at least 8 characters
Failed to upload file
The file you selected is too large. Please choose a file smaller than 10MB.
Warning Alerts
Use warning alerts to draw attention to important information that may require user consideration.
Attention needed
Your subscription will expire in 3 days. Please renew to continue using all features.
Storage almost full
You're using 95% of your storage space. Consider upgrading or deleting unused files.
Info Alerts
Use info alerts to provide neutral information or helpful tips to users.
New feature available
You can now assign multiple users to a single task. This feature is available in the task creation form.
Documentation updated
We've updated our API documentation with new examples and best practices. View documentation
Compact Alerts
Smaller alerts for inline feedback and status messages.
Interactive Examples
Try these interactive alert demonstrations to see behavior in action.
This alert can be dismissed
Click the close button to dismiss this alert.
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>