# @fayegram-ai/faye-ui/overlays/alert-dialog

Public exports and dependency-resolved component properties, with usage and rendering guidance.

## Import

```tsx
import { AlertDialog } from '@fayegram-ai/faye-ui/overlays/alert-dialog';
```

[Usage and behavior guide](/docs/dialogs/) · [API JSON](/api/packages/overlays/alert-dialog.json)

This entry declares a client boundary. Follow the rendering guide for framework integration.

## Public exports

| Name | Kind | Resolved declaration type |
|---|---|---|
| `AlertDialog` | value | `{ readonly Root: typeof Base.Root; readonly createHandle: typeof Base.createHandle; readonly Trigger: { (input: import("@base-ui/react").AlertDialogTriggerProps<unknown> & { variants?: { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "size"> \| undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "tone"> \| undefined; } \| undefined; }): import("react").ReactElement; displayName: string; }; readonly Backdrop: { (input: Omit<import("@base-ui/react").AlertDialogBackdropProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & { variants?: { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "size"> \| undefined; readonly to… (full type in API JSON)` |

## AlertDialog

Public component; use the linked family guide for complete composition and behavior.

Dependency-resolved declaration properties. Common React/native HTML attributes are omitted from the table; use the full declaration and React/native references. Generic and union restrictions remain authoritative in TypeScript.

### AlertDialog.Root

| Property | Required | Type | Meaning |
|---|---|---|---|
| `actionsRef` | No | `React.RefObject<DialogRootActions \| null> \| undefined` | A ref to imperative actions. - `unmount`: Manually unmounts the alert dialog. Call this after any externally controlled closing animation finishes. - `close`: Closes the alert dialog imperatively when called. |
| `children` | No | `React.ReactNode \| PayloadChildRenderFunction<Payload>` | The content of the dialog. This can be a regular React node or a render function that receives the `payload` of the active trigger. |
| `defaultOpen` | No | `boolean \| undefined` | Whether the dialog is initially open. To render a controlled dialog, use the `open` prop instead. |
| `defaultTriggerId` | No | `string \| null \| undefined` | ID of the trigger that the dialog is associated with. This is useful in conjunction with the `defaultOpen` prop to create an initially open dialog. |
| `handle` | No | `AlertDialogHandle<Payload> \| undefined` | A handle to associate the alert dialog with a trigger. If specified, allows external triggers to control the alert dialog's open state. Can be created with the AlertDialog.createHandle() method. |
| `onOpenChange` | No | `((open: boolean, eventDetails: AlertDialogRoot.ChangeEventDetails) => void) \| undefined` | Event handler called when the alert dialog is opened or closed. |
| `onOpenChangeComplete` | No | `((open: boolean) => void) \| undefined` | Event handler called after any animations complete when the dialog is opened or closed. |
| `open` | No | `boolean \| undefined` | Whether the dialog is currently open. |
| `triggerId` | No | `string \| null \| undefined` | ID of the trigger that the dialog is associated with. This is useful in conjunction with the `open` prop to create a controlled dialog. There's no need to specify this prop when the dialog is uncontrolled (that is, when the `open` prop is not set). |

### AlertDialog.Trigger

| Property | Required | Type | Meaning |
|---|---|---|---|
| `className` | No | `string \| ((state: DialogTriggerState) => string \| undefined) \| undefined` | CSS class applied to the element, or a function that returns a class based on the component's state. |
| `handle` | No | `Base.Handle<unknown> \| undefined` | A handle to associate the trigger with an alert dialog. Can be created with the AlertDialog.createHandle() method. |
| `id` | No | `string \| undefined` | ID of the trigger. In addition to being forwarded to the rendered element, it is also used to specify the active trigger for the dialog in controlled mode (with the DialogRoot `triggerId` prop). |
| `nativeButton` | No | `boolean \| undefined` | Whether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`). |
| `payload` | No | `unknown` | A payload to pass to the dialog when it is opened. |
| `render` | No | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, DialogTriggerState> \| undefined` | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
| `style` | No | `CSSProperties \| ((state: DialogTriggerState) => React.CSSProperties \| undefined) \| undefined` | Style applied to the element, or a function that returns a style object based on the component's state. |
| `variants` | No | `{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "size"> \| undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "tone"> \| undefined; } \| undefined` | See the usage contract and declaration. |

### AlertDialog.Backdrop

| Property | Required | Type | Meaning |
|---|---|---|---|
| `className` | No | `string \| ((state: DialogBackdropState) => string \| undefined) \| undefined` | CSS class applied to the element, or a function that returns a class based on the component's state. |
| `forceRender` | No | `boolean \| undefined` | Whether the backdrop is forced to render even when nested. |
| `render` | No | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, DialogBackdropState> \| undefined` | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
| `style` | No | `CSSProperties \| ((state: DialogBackdropState) => React.CSSProperties \| undefined) \| undefined` | Style applied to the element, or a function that returns a style object based on the component's state. |
| `variants` | No | `{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "size"> \| undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "tone"> \| undefined; } \| undefined` | See the usage contract and declaration. |

### AlertDialog.Popup

| Property | Required | Type | Meaning |
|---|---|---|---|
| `className` | No | `string \| ((state: DialogPopupState) => string \| undefined) \| undefined` | CSS class applied to the element, or a function that returns a class based on the component's state. |
| `finalFocus` | No | `boolean \| RefObject<HTMLElement \| null> \| ((closeType: InteractionType) => boolean \| HTMLElement \| null \| void) \| undefined` | Determines the element to focus when the dialog is closed. - `false`: Do not move focus. - `true`: Move focus based on the default behavior (trigger or previously focused element). - `RefObject`: Move focus to the ref element. - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`). Return an element to focus, `true` to use the default behavior, `null` to fall back to the default behavior, or `false`/`undefined` to do nothing. |
| `initialFocus` | No | `boolean \| RefObject<HTMLElement \| null> \| ((openType: InteractionType) => boolean \| HTMLElement \| null \| void) \| undefined` | Determines the element to focus when the dialog is opened. By default, focus moves to the first tabbable element inside the popup, except when the dialog is opened by touch — then the popup itself is focused to avoid opening the virtual keyboard. - `false`: Do not move focus. - `true`: Move focus based on the default behavior (first tabbable element or popup). - `RefObject`: Move focus to the ref element. - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`). Return an element to focus, `true` to use the default behavior, `null` to fall back to the default behavior, or `false`/`undefined` to do nothing. |
| `render` | No | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, DialogPopupState> \| undefined` | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
| `style` | No | `CSSProperties \| ((state: DialogPopupState) => React.CSSProperties \| undefined) \| undefined` | Style applied to the element, or a function that returns a style object based on the component's state. |
| `variants` | No | `{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "size"> \| undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "tone"> \| undefined; } \| undefined` | See the usage contract and declaration. |

### AlertDialog.Title

| Property | Required | Type | Meaning |
|---|---|---|---|
| `className` | No | `string \| ((state: DialogTitleState) => string \| undefined) \| undefined` | CSS class applied to the element, or a function that returns a class based on the component's state. |
| `render` | No | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, DialogTitleState> \| undefined` | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
| `style` | No | `CSSProperties \| ((state: DialogTitleState) => React.CSSProperties \| undefined) \| undefined` | Style applied to the element, or a function that returns a style object based on the component's state. |
| `variants` | No | `{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "size"> \| undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "tone"> \| undefined; } \| undefined` | See the usage contract and declaration. |

### AlertDialog.Description

| Property | Required | Type | Meaning |
|---|---|---|---|
| `className` | No | `string \| ((state: DialogDescriptionState) => string \| undefined) \| undefined` | CSS class applied to the element, or a function that returns a class based on the component's state. |
| `render` | No | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, DialogDescriptionState> \| undefined` | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
| `style` | No | `CSSProperties \| ((state: DialogDescriptionState) => React.CSSProperties \| undefined) \| undefined` | Style applied to the element, or a function that returns a style object based on the component's state. |
| `variants` | No | `{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "size"> \| undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "tone"> \| undefined; } \| undefined` | See the usage contract and declaration. |

### AlertDialog.Close

| Property | Required | Type | Meaning |
|---|---|---|---|
| `className` | No | `string \| ((state: DialogCloseState) => string \| undefined) \| undefined` | CSS class applied to the element, or a function that returns a class based on the component's state. |
| `nativeButton` | No | `boolean \| undefined` | Whether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`). |
| `render` | No | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, DialogCloseState> \| undefined` | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
| `style` | No | `CSSProperties \| ((state: DialogCloseState) => React.CSSProperties \| undefined) \| undefined` | Style applied to the element, or a function that returns a style object based on the component's state. |
| `variants` | No | `{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "size"> \| undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "tone"> \| undefined; } \| undefined` | See the usage contract and declaration. |

### AlertDialog.Viewport

**Example disposition:** Optional viewport composition for application-specific long content. The Dialog.Viewport live example exercises the scrollable layout; this short confirmation/drawer uses its existing direct popup composition.

| Property | Required | Type | Meaning |
|---|---|---|---|
| `className` | No | `string \| ((state: DialogViewportState) => string \| undefined) \| undefined` | CSS class applied to the element, or a function that returns a class based on the component's state. |
| `render` | No | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, DialogViewportState> \| undefined` | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
| `style` | No | `CSSProperties \| ((state: DialogViewportState) => React.CSSProperties \| undefined) \| undefined` | Style applied to the element, or a function that returns a style object based on the component's state. |
| `variants` | No | `{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "size"> \| undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "tone"> \| undefined; } \| undefined` | See the usage contract and declaration. |

### AlertDialog.Header

| Property | Required | Type | Meaning |
|---|---|---|---|
| `variants` | No | `{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "size"> \| undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "tone"> \| undefined; } \| undefined` | See the usage contract and declaration. |

### AlertDialog.Body

| Property | Required | Type | Meaning |
|---|---|---|---|
| `variants` | No | `{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "size"> \| undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "tone"> \| undefined; } \| undefined` | See the usage contract and declaration. |

### AlertDialog.Actions

| Property | Required | Type | Meaning |
|---|---|---|---|
| `variants` | No | `{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "size"> \| undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"alert-dialog", "tone"> \| undefined; } \| undefined` | See the usage contract and declaration. |

### AlertDialog.Portal

| Property | Required | Type | Meaning |
|---|---|---|---|
| `className` | No | `string \| ((state: DialogPortalState) => string \| undefined) \| undefined` | CSS class applied to the element, or a function that returns a class based on the component's state. |
| `container` | No | `HTMLElement \| ShadowRoot \| RefObject<HTMLElement \| ShadowRoot \| null> \| null \| undefined` | A parent element to render the portal element into. |
| `keepMounted` | No | `boolean \| undefined` | Whether to keep the portal mounted in the DOM while the popup is hidden. |
| `render` | No | `ReactElement<unknown, string \| JSXElementConstructor<any>> \| ComponentRenderFn<HTMLProps, DialogPortalState> \| undefined` | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render. |
| `style` | No | `CSSProperties \| ((state: DialogPortalState) => React.CSSProperties \| undefined) \| undefined` | Style applied to the element, or a function that returns a style object based on the component's state. |

## Defaults and customization

Descriptor defaults: `{"size":"md","tone":"neutral"}`. Parts: `trigger`, `backdrop`, `popup`, `title`, `description`, `close`, `viewport`, `header`, `body`, `actions`. Explicit instance props take precedence over configured defaults.

Use semantic tokens, public part hooks and customization sheets. Keep visual configuration separate from application state.

## State, events and accessibility

For interactive controls, pair a controlled value/open prop with its corresponding change callback; default props initialize uncontrolled state. Keep application validation and submission policy explicit. Name controls with visible labels, name icon-only actions on the button, and preserve focus and dismissal behavior when replacing parts. Use native form names and submit/reset types where supported. See the usage guide for component-specific behavior and live examples.

## Declaration authority

Generated from `packages/faye-ui/dist/overlays/alert-dialog.d.ts` after the semantic package build. Common native/React attributes are intentionally omitted from property tables. Generic overloads, discriminated unions and complete inherited attributes remain authoritative in installed TypeScript declarations. [React DOM attributes](https://react.dev/reference/react-dom/components/common) and [Base UI component contracts](https://base-ui.com/react/overview/quick-start) describe the inherited foundations.
