---
title: Alert Dialog
description: A modal dialog that interrupts the user with important content and expects a response.

link:
  doc: https://kobalte.dev/docs/core/components/alert-dialog
  api: https://kobalte.dev/docs/core/components/alert-dialog#api-reference
---

<ComponentPreview name="alert-dialog-demo">

```tsx file=<rootDir>/apps/docs/src/registry/examples/alert-dialog-demo.tsx

```

</ComponentPreview>

## Installation

<ComponentInstallation>

<Step>

<StepItem>Copy and paste the following code into your project:</StepItem>

  <ComponentSourceTabs>

    ```tsx title="components/ui/alert-dialog" file=<rootDir>/apps/docs/src/registry/ui/alert-dialog.tsx

    ```

    ```tsx title="components/ui/alert-dialog" file=<rootDir>/apps/unocss-playground/src/registry/ui/alert-dialog.tsx

    ```

  </ComponentSourceTabs>

</Step>

</ComponentInstallation>

## Usage

```tsx
import {
  AlertDialog,
  AlertDialogAction,
  AlertDialogCancel,
  AlertDialogContent,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogHeader,
  AlertDialogTitle,
  AlertDialogTrigger,
} from "@/components/ui/alert-dialog"
```

```tsx
<AlertDialog>
  <AlertDialogTrigger />
  <AlertDialogPortal>
    <AlertDialogContent>
      <AlertDialogHeader>
        <AlertDialogTitle />
        <AlertDialogDescription />
      </AlertDialogHeader>
      <AlertDialogFooter>
        <AlertDialogCancel />
        <AlertDialogAction />
      </AlertDialogFooter>
    </AlertDialogContent>
  </AlertDialogPortal>
</AlertDialog>
```
