# DialogProps (@salmonui/overlays/dialog)

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

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

```ts
import type { DialogProps } 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 DialogProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, 'open' | 'title' | 'onCancel' | 'onClose'> {
    readonly children?: ReactNode;
    readonly trigger?: ReactNode;
    readonly open?: boolean | undefined;
    readonly defaultOpen?: boolean | undefined;
    readonly onOpenChange?: ((open: boolean, event: DialogOpenChangeEvent) => void) | undefined;
    readonly onAfterOpen?: (() => void) | undefined;
    readonly onAfterClose?: (() => void) | undefined;
    readonly modal?: boolean | undefined;
    readonly dismissible?: boolean | {
        readonly escape?: boolean | undefined;
        readonly outside?: boolean | undefined;
    } | undefined;
    readonly onOverlayPress?: ((event: PointerEvent) => void) | undefined;
    readonly closeButton?: boolean | undefined;
    readonly title?: ReactNode;
    readonly initialFocus?: RefObject<HTMLElement | null> | false | undefined;
    readonly returnFocus?: boolean | undefined;
    readonly container?: Element | null | undefined;
    readonly keepMounted?: boolean | undefined;
    readonly placement?: 'center' | 'top' | undefined;
    readonly position?: DialogPosition | undefined;
    readonly defaultPosition?: DialogPosition | undefined;
    readonly onPositionChange?: ((position: DialogPosition) => void) | undefined;
    readonly width?: number | string | undefined;
    readonly height?: number | string | undefined;
    readonly minHeight?: number | string | undefined;
    readonly fullScreen?: boolean | 'mobile' | undefined;
    readonly draggable?: boolean | undefined;
    readonly dragHandle?: string | undefined;
    readonly onMoveStart?: (() => void) | undefined;
    readonly onMove?: ((position: DialogPosition) => void) | undefined;
    readonly onMoveEnd?: ((position: DialogPosition) => void) | undefined;
    readonly resizable?: boolean | readonly DialogResizeEdge[] | undefined;
    readonly onResizeStart?: (() => void) | undefined;
    readonly onResize?: ((size: DialogSize) => void) | undefined;
    readonly onResizeEnd?: ((size: DialogSize) => void) | undefined;
    readonly localeText?: DialogLocaleText | undefined;
    readonly classNames?: Partial<Record<DialogPart, string>> | undefined;
    readonly styles?: Partial<Record<DialogPart, CSSProperties>> | undefined;
    readonly ref?: Ref<HTMLDialogElement> | undefined;
}
```

Members (37):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `children` | `readonly children?: ReactNode;` | optional | Content parts: `Dialog.Title`, `Dialog.Description`, `Dialog.Body`, `Dialog.Footer`, `Dialog.Close`. |
| `trigger` | `readonly trigger?: ReactNode;` | optional | Rendered before the dialog with the dialog's context: usually a `Dialog.Trigger`. |
| `open` | `readonly open?: boolean \| undefined;` | optional |  |
| `defaultOpen` | `readonly defaultOpen?: boolean \| undefined;` | optional |  |
| `onOpenChange` | `readonly onOpenChange?: ((open: boolean, event: DialogOpenChangeEvent) => void) \| undefined;` | optional |  |
| `onAfterOpen` | `readonly onAfterOpen?: (() => void) \| undefined;` | optional |  |
| `onAfterClose` | `readonly onAfterClose?: (() => void) \| undefined;` | optional |  |
| `modal` | `readonly modal?: boolean \| undefined;` | optional | showModal() (default) or show() (modeless: no backdrop, no focus containment). |
| `dismissible` | `readonly dismissible?: boolean \| {     readonly escape?: boolean \| undefined;     readonly outside?: boolean \| undefined; } \| undefined;` | optional | Escape and backdrop dismissal. `true` = both, `false` = none. Default `{ escape: true, outside: false }`. |
| `onOverlayPress` | `readonly onOverlayPress?: ((event: PointerEvent) => void) \| undefined;` | optional | Press on the backdrop of a modal dialog. |
| `closeButton` | `readonly closeButton?: boolean \| undefined;` | optional | A close button in the corner (label `localeText.close`). Default false. |
| `title` | `readonly title?: ReactNode;` | optional | Shorthand for a `Dialog.Title` at the top. |
| `initialFocus` | `readonly initialFocus?: RefObject<HTMLElement \| null> \| false \| undefined;` | optional | Element focused on open (else `[data-autofocus]`, else the first focusable); `false` keeps the platform default. |
| `returnFocus` | `readonly returnFocus?: boolean \| undefined;` | optional | Return focus to the invoker on close. Default true. |
| `container` | `readonly container?: Element \| null \| undefined;` | optional | Modeless only: render the dialog inside this element (positioned in it) instead of in place. Mounted after hydration. |
| `keepMounted` | `readonly keepMounted?: boolean \| undefined;` | optional | Render the closed `<dialog>` too (content in the server HTML). |
| `placement` | `readonly placement?: 'center' \| 'top' \| undefined;` | optional | `'center'` (default) or `'top'`. |
| `position` | `readonly position?: DialogPosition \| undefined;` | optional |  |
| `defaultPosition` | `readonly defaultPosition?: DialogPosition \| undefined;` | optional |  |
| `onPositionChange` | `readonly onPositionChange?: ((position: DialogPosition) => void) \| undefined;` | optional |  |
| `width` | `readonly width?: number \| string \| undefined;` | optional |  |
| `height` | `readonly height?: number \| string \| undefined;` | optional |  |
| `minHeight` | `readonly minHeight?: number \| string \| undefined;` | optional |  |
| `fullScreen` | `readonly fullScreen?: boolean \| 'mobile' \| undefined;` | optional | Fill the viewport, or only below the mobile width (640 px). |
| `draggable` | `readonly draggable?: boolean \| undefined;` | optional | Drag by `dragHandle` (default the title); lazy chunk. |
| `dragHandle` | `readonly dragHandle?: string \| undefined;` | optional | CSS selector of the drag handle inside the dialog. Default `.salmon-dialog-title`. |
| `onMoveStart` | `readonly onMoveStart?: (() => void) \| undefined;` | optional |  |
| `onMove` | `readonly onMove?: ((position: DialogPosition) => void) \| undefined;` | optional | Per animation frame during a drag; not for React state. |
| `onMoveEnd` | `readonly onMoveEnd?: ((position: DialogPosition) => void) \| undefined;` | optional |  |
| `resizable` | `readonly resizable?: boolean \| readonly DialogResizeEdge[] \| undefined;` | optional | Resize from `['bottomEnd']` (`true`) or the given edges; lazy chunk. |
| `onResizeStart` | `readonly onResizeStart?: (() => void) \| undefined;` | optional |  |
| `onResize` | `readonly onResize?: ((size: DialogSize) => void) \| undefined;` | optional |  |
| `onResizeEnd` | `readonly onResizeEnd?: ((size: DialogSize) => void) \| undefined;` | optional |  |
| `localeText` | `readonly localeText?: DialogLocaleText \| undefined;` | optional |  |
| `classNames` | `readonly classNames?: Partial<Record<DialogPart, string>> \| undefined;` | optional |  |
| `styles` | `readonly styles?: Partial<Record<DialogPart, CSSProperties>> \| undefined;` | optional |  |
| `ref` | `readonly ref?: Ref<HTMLDialogElement> \| undefined;` | optional | The `<dialog>` element. |
