# dialog

```ts
import { DialogModule } from '@anguless/angulux/dialog';
```

## Dialog

`agl-dialog` — component

Inherits every input, output and slot of `BaseComponent` — see [basecomponent.md](basecomponent.md).

Dialog is a container to display content in an overlay window.

| Input | Type | Default | Description |
| --- | --- | --- | --- |
| `hostName` | `string` | _not documented_ |  |
| `header` | `string \| undefined` | _not documented_ | Title text of the dialog. |
| `draggable` | `boolean` | _not documented_ | Enables dragging to change the position using header.  Accessibility, a known limit: the dialog moves with the pointer only, and no key moves it. Everything inside it works from the keyboard, and nothing depends on where it sits, so a keyboard user loses a convenience, not a function. |
| `resizable` | `boolean` | _not documented_ | Enables resizing of the content.  Accessibility, a known limit: the dialog resizes with the pointer only, and no key resizes it. Give it a size that fits its content; `maximizable` adds a button, which the keyboard reaches, that makes it fill the viewport. |
| `contentStyle` | `any` | _not documented_ | Style of the content section. |
| `contentStyleClass` | `string \| undefined` | _not documented_ | Style class of the content. |
| `modal` | `boolean` | _not documented_ | Defines if background should be blocked when dialog is displayed. |
| `closeOnEscape` | `boolean` | _not documented_ | Specifies if pressing escape key should hide the dialog. |
| `dismissableMask` | `boolean` | _not documented_ | Specifies if clicking the modal background should hide the dialog. |
| `rtl` | `boolean` | _not documented_ | When enabled dialog is displayed in RTL direction. |
| `closable` | `boolean` | _not documented_ | Adds a close icon to the header to hide the dialog. |
| `breakpoints` | `any` | _not documented_ | Object literal to define widths per screen size. |
| `styleClass` | `string \| undefined` | _not documented_ | Style class of the component. |
| `maskStyleClass` | `string \| undefined` | _not documented_ | Style class of the mask. |
| `maskStyle` | `{ [klass: string]: any } \| null \| undefined` | _not documented_ | Style of the mask. |
| `showHeader` | `boolean` | _not documented_ | Whether to show the header or not. |
| `blockScroll` | `boolean` | _not documented_ | Whether background scroll should be blocked when dialog is visible. |
| `autoZIndex` | `boolean` | _not documented_ | Whether to automatically manage layering. |
| `baseZIndex` | `number` | _not documented_ | Base zIndex value to use in layering. |
| `minX` | `number` | _not documented_ | Minimum value for the left coordinate of dialog in dragging. |
| `minY` | `number` | _not documented_ | Minimum value for the top coordinate of dialog in dragging. |
| `focusOnShow` | `boolean` | _not documented_ | When enabled, focus moves into the dialog on show: to the `initialFocus` target, else an element marked `autofocus` in the content, else the first focusable element. |
| `initialFocus` | `string \| undefined` | _not documented_ | Names the element that receives focus when the dialog opens: a CSS selector matched inside the dialog. Use it when the first field is not the one to type into, or when a lint rule forbids the `autofocus` attribute. Applies with `focusOnShow`. |
| `maximizable` | `boolean` | _not documented_ | Whether the dialog can be displayed full screen. |
| `keepInViewport` | `boolean` | _not documented_ | Keeps dialog in the viewport. |
| `focusTrap` | `boolean` | _not documented_ | When enabled, can only focus on elements inside the dialog. |
| `transitionOptions` | `string` | _not documented_ | Transition options of the animation. **Deprecated:** since v21.0.0. Use `motionOptions` instead. |
| `maskMotionOptions` | `MotionOptions \| undefined` | _not documented_ | The motion options for the mask. |
| `motionOptions` | `MotionOptions \| undefined` | _not documented_ | The motion options. |
| `closeIcon` | `string \| undefined` | _not documented_ | Name of the close icon. |
| `closeAriaLabel` | `string \| undefined` | _not documented_ | Defines a string that labels the close button for accessibility. |
| `closeTabindex` | `string` | _not documented_ | Index of the close button in tabbing order. |
| `minimizeIcon` | `string \| undefined` | _not documented_ | Name of the minimize icon. |
| `maximizeIcon` | `string \| undefined` | _not documented_ | Name of the maximize icon. |
| `closeButtonProps` | `ButtonProps` | _not documented_ | Used to pass all properties of the ButtonProps to the Button component. |
| `maximizeButtonProps` | `ButtonProps` | _not documented_ | Used to pass all properties of the ButtonProps to the Button component. |
| `visible` | `boolean` | _not documented_ | Specifies the visibility of the dialog. |
| `style` | `any` | _not documented_ | Inline style of the component. |
| `position` | `'center' \| 'top' \| 'bottom' \| 'left' \| 'right' \| 'topleft' \| 'topright' \| 'bottomleft' \| 'bottomright'` | _not documented_ | Position of the dialog. |
| `role` | `string` | _not documented_ | Role attribute of html element. |
| `appendTo` | `HTMLElement \| ElementRef \| TemplateRef<any> \| 'self' \| 'body' \| null \| undefined \| any` | `'self'` | Target element to attach the overlay, valid values are "body" or a local ng-template variable of another element (note: use binding with brackets for template variables, e.g. [appendTo]="mydiv" for a div element having #mydiv as variable name). |
| `content` | `TemplateRef<void> \| undefined` | _not documented_ | Header template. _(property `headerTemplate`)_ |
| `contentTemplate` | `TemplateRef<void> \| undefined` | _not documented_ | Content template. |
| `footerTemplate` | `TemplateRef<void> \| undefined` | _not documented_ | Footer template. |
| `closeIconTemplate` | `TemplateRef<void> \| undefined` | _not documented_ | Close icon template. |
| `maximizeIconTemplate` | `TemplateRef<void> \| undefined` | _not documented_ | Maximize icon template. |
| `minimizeIconTemplate` | `TemplateRef<void> \| undefined` | _not documented_ | Minimize icon template. |
| `headlessTemplate` | `TemplateRef<void> \| undefined` | _not documented_ | Headless template. |

| Output | Type | Description |
| --- | --- | --- |
| `onShow` | `EventEmitter<any>` | Callback to invoke when dialog is shown. |
| `onHide` | `EventEmitter<any>` | Callback to invoke when dialog is hidden. |
| `visibleChange` | `EventEmitter<boolean>` | This EventEmitter is used to notify changes in the visibility state of a component. |
| `onResizeInit` | `EventEmitter<MouseEvent>` | Callback to invoke when dialog resizing is initiated. |
| `onResizeEnd` | `EventEmitter<MouseEvent>` | Callback to invoke when dialog resizing is completed. |
| `onDragEnd` | `EventEmitter<DragEvent>` | Callback to invoke when dialog dragging is completed. |
| `onMaximize` | `EventEmitter<any>` | Callback to invoke when dialog maximized or unmaximized. |

| Slot | Read as | Description |
| --- | --- | --- |
| `<ng-template #header>` | `_headerTemplate` | Custom header template. |
| `<ng-template #content>` | `_contentTemplate` | Custom content template. |
| `<ng-template #footer>` | `_footerTemplate` | Custom footer template. |
| `<ng-template #closeicon>` | `_closeiconTemplate` | Custom close icon template. |
| `<ng-template #maximizeicon>` | `_maximizeiconTemplate` | Custom maximize icon template. |
| `<ng-template #minimizeicon>` | `_minimizeiconTemplate` | Custom minimize icon template. |
| `<ng-template #headless>` | `_headlessTemplate` | Custom headless template. |
