> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pharen.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Alert dialog

> Import and use the Alert dialog components from @pharen/ui.

export const PharenUiPreview = ({name, title = 'Pharen UI component preview'}) => <div className="not-prose my-6 overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm dark:border-white/10 dark:bg-zinc-950">
    <div className="pharen-ui-preview-root" data-pharen-ui-preview data-example={name} role="region" aria-label={title} />
  </div>;

Use **Alert dialog** to confirm a consequential action. This page covers every Vue component exported by the public module.

<PharenUiPreview name="alert-dialog" title="Alert dialog preview" />

<Accordion title="View code">
  ```vue theme={null}
  <script setup lang="ts">
  import { AlertDialog, AlertDialogTrigger, AlertDialogContent } from '@pharen/ui';
  </script>

  <template>
    <AlertDialog>
      <AlertDialogTrigger>Open alert dialog</AlertDialogTrigger>
      <AlertDialogContent>Alert dialog content</AlertDialogContent>
    </AlertDialog>
  </template>
  ```
</Accordion>

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install @pharen/ui
  ```

  ```bash pnpm theme={null}
  pnpm add @pharen/ui
  ```

  ```bash yarn theme={null}
  yarn add @pharen/ui
  ```

  ```bash bun theme={null}
  bun add @pharen/ui
  ```
</CodeGroup>

<Note>
  Import `@pharen/ui/styles.css` exactly once in your application entrypoint.
</Note>

## Usage

```ts theme={null}
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger } from '@pharen/ui';
```

## Exports

| Export                   | Purpose                                  |
| ------------------------ | ---------------------------------------- |
| `AlertDialog`            | Exported Vue component from this module. |
| `AlertDialogAction`      | Exported Vue component from this module. |
| `AlertDialogCancel`      | Exported Vue component from this module. |
| `AlertDialogContent`     | Contains the visible content.            |
| `AlertDialogDescription` | Renders supporting description.          |
| `AlertDialogFooter`      | Structures the footer region.            |
| `AlertDialogHeader`      | Structures the header region.            |
| `AlertDialogMedia`       | Exported Vue component from this module. |
| `AlertDialogOverlay`     | Exported Vue component from this module. |
| `AlertDialogPortal`      | Exported Vue component from this module. |
| `AlertDialogTitle`       | Renders the accessible title.            |
| `AlertDialogTrigger`     | Opens or activates the component.        |

## Source

[Open the source on GitHub](https://github.com/PharenIT/ELEV8-Labs/tree/main/src/packages/ui/src/components/alert-dialog)
