Alert
Status messages for important information with different severity levels.
Based on APG Alert Pattern.
Demo
Information
This is a status alert for general information.
Success
Your changes have been saved successfully.
Warning
Please review your input before continuing.
Error
An error occurred while processing your request.
Usage
// Import styled alert
@styled_alert.alert(
variant=Error,
title="Error",
description="An error occurred while processing your request.",
)
Variants
| Variant | Use Case |
|---|---|
Status | General information |
Success | Positive confirmation |
Warning | Caution or attention needed |
Error | Error or failure |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | AlertVariant | - | Status, Success, Warning, or Error |
| title | String? | None | Alert title text |
| description | String? | None | Alert description text |
| class | String? | None | Additional CSS class |
| children | Array[Node]? | None | Custom content |
BEM Classes
| Class | Description |
|---|---|
.alert | Root container |
.alert__title | Title text |
.alert__description | Description text |
.alert--error | Error variant |
.alert--warning | Warning variant |
.alert--success | Success variant |
.alert--status | Status/info variant |
Accessibility
role="alert"for screen reader announcementaria-live="polite"for dynamic updatesColor-coded border with semantic meaning
High contrast text for readability