This is an informational alert message.Operation completed successfully!Warning: This action cannot be undone.Error: Unable to save changes. Please try again.
<div style="display: flex; flex-direction: column; gap: 1rem;">
<ae-alert variant="info">This is an informational alert message.</ae-alert>
<ae-alert variant="success">Operation completed successfully!</ae-alert>
<ae-alert variant="warning">Warning: This action cannot be undone.</ae-alert>
<ae-alert variant="error">Error: Unable to save changes. Please try again.</ae-alert>
</div>
Customize the appearance of alerts using CSS parts and custom properties.
A styled info alert with a left border.
A styled success alert with a left border.
A styled warning alert with a left border.
A styled error alert with a left border.
<style>
.custom-alert {
--ae-alert-radius: 0;
--ae-alert-padding: 1.25rem;
}
.custom-alert::part(base) {
border-left: 4px solid var(--theme-color, #0066ff);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.custom-alert[variant="info"] {
--theme-color: #0066ff;
}
.custom-alert[variant="success"] {
--theme-color: #10b981;
}
.custom-alert[variant="warning"] {
--theme-color: #f59e0b;
}
.custom-alert[variant="error"] {
--theme-color: #ef4444;
}
</style>
<div style="display: flex; flex-direction: column; gap: 1rem;">
<ae-alert class="custom-alert" variant="info">
A styled info alert with a left border.
</ae-alert>
<ae-alert class="custom-alert" variant="success">
A styled success alert with a left border.
</ae-alert>
<ae-alert class="custom-alert" variant="warning">
A styled warning alert with a left border.
</ae-alert>
<ae-alert class="custom-alert" variant="error">
A styled error alert with a left border.
</ae-alert>
</div>