

<InteractiveDemo
  name="alert"
  fallback="`<Alert>
<AlertTitle>Alert Title</AlertTitle>
<AlertDescription>This is an alert description.</AlertDescription>

</Alert>`"
  controls="[
  { name: &#x22;title&#x22;, type: &#x22;string&#x22;, defaultValue: &#x22;Alert Title&#x22;, alwaysShow: true },
  { name: &#x22;description&#x22;, type: &#x22;string&#x22;, defaultValue: &#x22;This is an alert description.&#x22;, alwaysShow: true },
  &#x22;variant&#x22;,
  { name: &#x22;icon&#x22;, type: &#x22;icon&#x22; },
]"
/>

## Installation [#installation]

<CodeBlockTabs defaultValue="npm">
  <CodeBlockTabsList>
    <CodeBlockTabsTrigger value="npm">
      npm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="pnpm">
      pnpm
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="yarn">
      yarn
    </CodeBlockTabsTrigger>

    <CodeBlockTabsTrigger value="bun">
      bun
    </CodeBlockTabsTrigger>
  </CodeBlockTabsList>

  <CodeBlockTab value="npm">
    ```bash
    npx shadcn@latest add @dotui/alert
    ```
  </CodeBlockTab>

  <CodeBlockTab value="pnpm">
    ```bash
    pnpm dlx shadcn@latest add @dotui/alert
    ```
  </CodeBlockTab>

  <CodeBlockTab value="yarn">
    ```bash
    yarn dlx shadcn@latest add @dotui/alert
    ```
  </CodeBlockTab>

  <CodeBlockTab value="bun">
    ```bash
    bun x shadcn@latest add @dotui/alert
    ```
  </CodeBlockTab>
</CodeBlockTabs>

## Usage [#usage]

Use alerts to display important messages that require user attention.

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

```tsx
<Alert>
  <AlertTitle>Alert Title</AlertTitle>
  <AlertDescription>Alert description</AlertDescription>
</Alert>
```

## Examples [#examples]

<Examples className="grid-cols-1 lg:grid-cols-2">
  <Example name="alert/demos/default" title="Default" />

  <Example name="alert/demos/warning" title="Warning" />

  <Example name="alert/demos/danger" title="Danger" />

  <Example name="alert/demos/success" title="Success" />

  <Example name="alert/demos/custom-icon" title="Custom Icon" />

  <Example name="alert/demos/action" title="Action" />
</Examples>

## API Reference [#api-reference]

### Alert [#alert]

<Reference name="alert" />

### AlertTitle [#alerttitle]

<Reference name="alert-title" />

### AlertDescription [#alertdescription]

<Reference name="alert-description" />

### AlertAction [#alertaction]

<Reference name="alert-action" />
