# Alert

> Inline alert with optional indicator, title, and description.

Registry name: `alert`. HTML docs: https://ui.anuragroy.dev/component/alert.

## Install

```bash
npx shadcn@latest add https://ui.anuragroy.dev/r/alert.json
```

If the website is down: `npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/alert.json`.

Registry JSON: https://ui.anuragroy.dev/r/alert.json (GitHub: https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/alert.json).

## Import

Import paths follow the consumer `components.json` aliases. After a default install:

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

## Usage

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

export function Example() {
  return (
    <Alert variant="success">
      <AlertIndicator variant="success" />
      <div>
        <AlertTitle>Saved</AlertTitle>
        <AlertDescription>Your changes have been saved.</AlertDescription>
      </div>
    </Alert>
  )
}
```

## API

### Alert

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | "default" \| "primary" \| "success" \| "warning" \| "destructive" | "default" |  |

### AlertIndicator

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | "default" \| "primary" \| "success" \| "warning" \| "destructive" | "default" |  |

## See also

- [HTML page](https://ui.anuragroy.dev/component/alert): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/alert.json): Source files and dependencies.
- [Catalog](https://ui.anuragroy.dev/component): All components.
- [llms.txt](https://ui.anuragroy.dev/llms.txt): Agent index for this library.
