# AlertDialogProps (@salmonui/overlays/dialog)

> The AlertDialogProps interface of @salmonui/overlays/dialog.

Canonical: https://salmonui.dev/docs/reference/overlays/dialog/AlertDialogProps

```ts
import type { AlertDialogProps } from '@salmonui/overlays/dialog';
```

Entry index: https://salmonui.dev/docs/reference/overlays/dialog (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/overlays/dialog.md).

## Reference

Kind: interface

```ts
interface AlertDialogProps extends Omit<DialogProps, 'title' | 'dismissible' | 'trigger' | 'children' | 'localeText'> {
    readonly title: ReactNode;
    readonly description?: ReactNode;
    readonly children?: ReactNode;
    readonly trigger?: ReactNode;
    readonly confirmLabel?: ReactNode;
    readonly cancelLabel?: ReactNode;
    readonly confirmIcon?: ReactNode;
    readonly cancelIcon?: ReactNode;
    readonly tone?: 'primary' | 'danger' | undefined;
    readonly onConfirm?: ((formData: FormData | undefined) => unknown) | undefined;
    readonly onCancel?: (() => void) | undefined;
    readonly dismissible?: boolean | undefined;
    readonly localeText?: AlertDialogLocaleText | undefined;
}
```

Members (45):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `title` | `readonly title: ReactNode;` |  |  |
| `description` | `readonly description?: ReactNode;` | optional |  |
| `children` | `readonly children?: ReactNode;` | optional | Form fields (a prompt): the body and actions become a `<form>`; submitting it (Enter or the confirm button) calls `onConfirm(formData)`. |
| `trigger` | `readonly trigger?: ReactNode;` | optional |  |
| `confirmLabel` | `readonly confirmLabel?: ReactNode;` | optional |  |
| `cancelLabel` | `readonly cancelLabel?: ReactNode;` | optional | Without a cancel label (and without `localeText.cancel` plus `onCancel`) the dialog is an alert with one action. |
| `confirmIcon` | `readonly confirmIcon?: ReactNode;` | optional |  |
| `cancelIcon` | `readonly cancelIcon?: ReactNode;` | optional |  |
| `tone` | `readonly tone?: 'primary' \| 'danger' \| undefined;` | optional | `'danger'` styles the confirm button for destructive actions. |
| `onConfirm` | `readonly onConfirm?: ((formData: FormData \| undefined) => unknown) \| undefined;` | optional | May return a promise: the confirm button shows its loading state and the dialog stays open until it settles. While pending, Cancel is disabled and Escape and the close button are ignored. A rejection keeps the dialog open and shows the reason's `Error` message (else `localeText.error`) in a `role="alert"` region above the actions; confirming again clears it. |
| `onCancel` | `readonly onCancel?: (() => void) \| undefined;` | optional |  |
| `dismissible` | `readonly dismissible?: boolean \| undefined;` | optional | Escape cancels. Default true. |
| `localeText` | `readonly localeText?: AlertDialogLocaleText \| undefined;` | optional |  |
| `open` | `open?: boolean;` | optional, inherited |  |
| `defaultOpen` | `defaultOpen?: boolean;` | optional, inherited |  |
| `onOpenChange` | `onOpenChange?: ((open: boolean, event: DialogOpenChangeEvent) => void);` | optional, inherited |  |
| `onAfterOpen` | `onAfterOpen?: (() => void);` | optional, inherited |  |
| `onAfterClose` | `onAfterClose?: (() => void);` | optional, inherited |  |
| `modal` | `modal?: boolean;` | optional, inherited | showModal() (default) or show() (modeless: no backdrop, no focus containment). |
| `onOverlayPress` | `onOverlayPress?: ((event: PointerEvent) => void);` | optional, inherited | Press on the backdrop of a modal dialog. |
| `closeButton` | `closeButton?: boolean;` | optional, inherited | A close button in the corner (label `localeText.close`). Default false. |
| `initialFocus` | `initialFocus?: false \| RefObject<HTMLElement \| null>;` | optional, inherited | Element focused on open (else `[data-autofocus]`, else the first focusable); `false` keeps the platform default. |
| `returnFocus` | `returnFocus?: boolean;` | optional, inherited | Return focus to the invoker on close. Default true. |
| `container` | `container?: Element \| null;` | optional, inherited | Modeless only: render the dialog inside this element (positioned in it) instead of in place. Mounted after hydration. |
| `keepMounted` | `keepMounted?: boolean;` | optional, inherited | Render the closed `<dialog>` too (content in the server HTML). |
| `placement` | `placement?: "center" \| "top";` | optional, inherited | `'center'` (default) or `'top'`. |
| `position` | `position?: DialogPosition;` | optional, inherited |  |
| `defaultPosition` | `defaultPosition?: DialogPosition;` | optional, inherited |  |
| `onPositionChange` | `onPositionChange?: ((position: DialogPosition) => void);` | optional, inherited |  |
| `width` | `width?: string \| number;` | optional, inherited |  |
| `height` | `height?: string \| number;` | optional, inherited |  |
| `minHeight` | `minHeight?: string \| number;` | optional, inherited |  |
| `fullScreen` | `fullScreen?: "mobile" \| boolean;` | optional, inherited | Fill the viewport, or only below the mobile width (640 px). |
| `draggable` | `draggable?: boolean;` | optional, inherited | Drag by `dragHandle` (default the title); lazy chunk. |
| `dragHandle` | `dragHandle?: string;` | optional, inherited | CSS selector of the drag handle inside the dialog. Default `.salmon-dialog-title`. |
| `onMoveStart` | `onMoveStart?: (() => void);` | optional, inherited |  |
| `onMove` | `onMove?: ((position: DialogPosition) => void);` | optional, inherited | Per animation frame during a drag; not for React state. |
| `onMoveEnd` | `onMoveEnd?: ((position: DialogPosition) => void);` | optional, inherited |  |
| `resizable` | `resizable?: boolean \| readonly DialogResizeEdge[];` | optional, inherited | Resize from `['bottomEnd']` (`true`) or the given edges; lazy chunk. |
| `onResizeStart` | `onResizeStart?: (() => void);` | optional, inherited |  |
| `onResize` | `onResize?: ((size: DialogSize) => void);` | optional, inherited |  |
| `onResizeEnd` | `onResizeEnd?: ((size: DialogSize) => void);` | optional, inherited |  |
| `classNames` | `classNames?: Partial<Record<"closeButton", string>>;` | optional, inherited |  |
| `styles` | `styles?: Partial<Record<"closeButton", CSSProperties>>;` | optional, inherited |  |
| `ref` | `ref?: Ref<HTMLDialogElement>;` | optional, inherited | The `<dialog>` element. |
