Installation
CLI
Install the component using the StarUI CLI:
Examples
With Actions
Alerts with buttons for user response — upgrade prompts, storage warnings
Form Validation
Error summary with a structured list of field-level issues
Custom Icon Styling
Convey intent by pairing colored icons with the default variant — not built-in variants
Without Icon
Alert with just a title and description, no icon column
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant |
Literal['default', 'destructive'] |
'default' |
Visual style variant |
live |
bool |
False |
When True, sets role='alert' for screen reader live region announcements. Use only for dynamically inserted alerts |
cls |
str |
'' |
Additional CSS classes |
| Component | Description |
|---|---|
Alert |
Root container. Uses CSS grid for icon + content layout |
AlertTitle |
Bold single-line heading (clamped with line-clamp-1) |
AlertDescription |
Supporting content — accepts text, paragraphs, lists, or any rich content |