# Alert
> Status message component using the AlertVariant enum for Default and Destructive styles.
Source: https://shellui.dev/docs/v0.4/components/data-display/alert
## Overview
The Alert component displays important messages and status information. It uses the `AlertVariant` enum to control visual style and accepts an optional `Icon` render fragment. Classes are merged with `Shell.Cn()`.
## Installation
```bash
shellui add alert
```
## Usage
### Default Alert
```razor
This is a default informational alert message.
```
### Destructive Alert
```razor
This action cannot be undone. Please proceed with caution.
```
### Alert with Custom Icon
The `Icon` parameter accepts a `RenderFragment` for placing an icon:
```razor
Your changes have been saved successfully!
```
### Without Title
```razor
A simple alert without a title.
```
### Destructive with Icon
```razor
There was a problem deleting this resource. Please try again.
```
### Custom Styling
```razor
Custom-styled alert with class overrides.
```
## API Reference
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `Variant` | `AlertVariant` | `AlertVariant.Default` | Visual style of the alert |
| `Title` | `string` | `""` | Alert heading text |
| `Icon` | `RenderFragment?` | `null` | Optional icon content |
| `ChildContent` | `RenderFragment` | — | Alert body message |
| `Class` | `string?` | `null` | Additional CSS classes merged via `Shell.Cn()` |
### AlertVariant Enum
| Value | Description |
|-------|-------------|
| `Default` | Standard informational style |
| `Destructive` | Red / error style for warnings and errors |
## Accessibility
- Rendered with `role="alert"` so screen readers announce the content immediately.
- The `Title` is displayed as a heading within the alert region.
- Color is never the sole indicator — text and icons provide redundant meaning.