Alert
Payment successful
New feature available
Usage
Include CSS
Import Tailwind and one full A3S UI style bundle.
Or import only the base CSS, Alert component CSS, and one style pack.
Using CDN or bundler imports? See the Installation page.
Add your alert HTML
Use alert for default styling. Add data-variant="destructive" for error states. Add a direct child <footer> for an inline-end action region.
HTML structure
<div class="alert">Main container. Use
data-variant="destructive"for error states.<svg>Optional- The icon.
<h2>- The title.
<section>Optional- The description.
<footer>Optional- The action region, aligned to the inline end of the alert. Put the action element inside it, such as a button or link.
Examples
Basic
A basic alert with an icon, title and description.
Account updated successfully
Destructive
Use data-variant="destructive" to create a destructive alert.
Payment failed
Action
Use <footer> to add a button or other action element to the alert.
Dark mode is now available
Custom colors
You can customize the alert colors by adding custom classes such as bg-amber-50 dark:bg-amber-950 to the alert.
Your subscription will expire in 3 days.
RTL
Add dir="rtl" to the alert or an ancestor.