# Alert

> A status banner with variants, dismiss action, and optional action slot.

- Tier: free, MIT
- Category: Feedback
- Docs: https://ui.mlola.com/docs/components/alert

## Install

```bash
npx mlola-ui add alert
```

```tsx
import { Alert } from "@/components/ui/alert";
```

## Props with fixed values

| Component | Prop | Values | Default | Description |
| --- | --- | --- | --- | --- |
| Alert | `tone` | `neutral`, `info`, `success`, `warning`, `danger` | `neutral` |  |
| Alert | `variant` | `card`, `soft` | `card` |  |

## Example

```tsx
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";

export default function Example() {
  return (
    <Alert tone="warning">
      <AlertTitle>Your card expires soon</AlertTitle>
      <AlertDescription>Update it before September 30 to keep your plan.</AlertDescription>
    </Alert>
  );
}
```

## The same markup without React

```html
<div class="ml-alert" role="alert" data-tone="warning" data-variant="card" data-state="open">
  <span class="ml-alert-icon" aria-hidden="true"><svg class="mlola-glyph" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--mlola-glyph-stroke, var(--ml-icon-stroke, 1.75))" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true" data-optical-size="default" style="color:var(--mlola-glyph-color, currentColor);scale:var(--mlola-glyph-optical-scale, 1);transform-origin:center"><path d="m10.3 3.8-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.7-3.2l-8-14a2 2 0 0 0-3.4 0Z" pathLength="1"></path><path d="M12 9v4M12 17h.01" pathLength="1"></path></svg></span>
  <div class="ml-alert-content">
    <p class="ml-alert-title">Your card expires soon</p>
    <div class="ml-alert-description">Update it before September 30 to keep your plan.</div>
  </div>
</div>
```
