---
title: Dialog
description: A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.

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

<ComponentPreview name="dialog-demo">

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

```

</ComponentPreview>

## Installation

<ComponentInstallation>

<Step>

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

  <ComponentSourceTabs>

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

    ```

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

    ```

  </ComponentSourceTabs>

</Step>

</ComponentInstallation>

## Usage

```tsx
import {
  Dialog,
  DialogContent,
  DialogDescription,
  DialogHeader,
  DialogPortal,
  DialogTitle,
  DialogTrigger,
} from "@/components/ui/dialog"
```

```tsx
<Dialog>
  <DialogTrigger />
  <DialogPortal>
    <DialogContent>
      <DialogHeader>
        <DialogTitle />
        <DialogDescription />
      </DialogHeader>
    </DialogContent>
  </DialogPortal>
</Dialog>
```
