Skip to content
angulux
@anguless/angulux/dialog

dialog

1 declarations3 demos
import
import { DialogModule } from '@anguless/angulux/dialog';

Basic

Visibility is controlled by the visible property and its visibleChange output.

<agl-button label="Show" (onClick)="visible.set(true)" /><agl-dialog header="Edit Profile" [visible]="visible()" (visibleChange)="visible.set($event)" [style]="{ width: '25rem' }">    <p>Update your information and click Save when you are done.</p></agl-dialog>

Modal

A modal dialog blocks the page behind it and traps focus until it closes.

<agl-button label="Show modal" (onClick)="visible.set(true)" /><agl-dialog header="Confirm" [visible]="visible()" (visibleChange)="visible.set($event)" [modal]="true" [style]="{ width: '25rem' }">    <p>A modal dialog blocks the page behind it and traps focus until it closes.</p>    <ng-template #footer>        <agl-button label="Cancel" severity="secondary" [outlined]="true" (onClick)="visible.set(false)" />        <agl-button label="Confirm" (onClick)="visible.set(false)" />    </ng-template></agl-dialog>

Maximizable

Maximizable adds a header control that expands the dialog to the full viewport.

<agl-button label="Show maximizable" (onClick)="visible.set(true)" /><agl-dialog header="Report" [visible]="visible()" (visibleChange)="visible.set($event)" [modal]="true" [maximizable]="true" [style]="{ width: '30rem' }">    <p>Maximizable adds a control to the header that expands the dialog to the full viewport and back.</p></agl-dialog>

API

Generated from the committed corpus, which check:corpus holds to the built library.

Dialog

componentagl-dialog

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

InputTypeDefaultDescription
hostNamestringnot documented
headerstring | undefinednot documentedTitle text of the dialog.
draggablebooleannot documentedEnables dragging to change the position using header.
resizablebooleannot documentedEnables resizing of the content.
contentStyleanynot documentedStyle of the content section.
contentStyleClassstring | undefinednot documentedStyle class of the content.
modalbooleannot documentedDefines if background should be blocked when dialog is displayed.
closeOnEscapebooleannot documentedSpecifies if pressing escape key should hide the dialog.
dismissableMaskbooleannot documentedSpecifies if clicking the modal background should hide the dialog.
rtlbooleannot documentedWhen enabled dialog is displayed in RTL direction.
closablebooleannot documentedAdds a close icon to the header to hide the dialog.
breakpointsanynot documentedObject literal to define widths per screen size.
styleClassstring | undefinednot documentedStyle class of the component.
maskStyleClassstring | undefinednot documentedStyle class of the mask.
maskStyle{ [klass: string]: any } | null | undefinednot documentedStyle of the mask.
showHeaderbooleannot documentedWhether to show the header or not.
blockScrollbooleannot documentedWhether background scroll should be blocked when dialog is visible.
autoZIndexbooleannot documentedWhether to automatically manage layering.
baseZIndexnumbernot documentedBase zIndex value to use in layering.
minXnumbernot documentedMinimum value for the left coordinate of dialog in dragging.
minYnumbernot documentedMinimum value for the top coordinate of dialog in dragging.
focusOnShowbooleannot documentedWhen enabled, first focusable element receives focus on show.
maximizablebooleannot documentedWhether the dialog can be displayed full screen.
keepInViewportbooleannot documentedKeeps dialog in the viewport.
focusTrapbooleannot documentedWhen enabled, can only focus on elements inside the dialog.
transitionOptions
deprecated — since v21.0.0. Use `motionOptions` instead.
stringnot documentedTransition options of the animation.
maskMotionOptionsMotionOptions | undefinednot documentedThe motion options for the mask.
motionOptionsMotionOptions | undefinednot documentedThe motion options.
closeIconstring | undefinednot documentedName of the close icon.
closeAriaLabelstring | undefinednot documentedDefines a string that labels the close button for accessibility.
closeTabindexstringnot documentedIndex of the close button in tabbing order.
minimizeIconstring | undefinednot documentedName of the minimize icon.
maximizeIconstring | undefinednot documentedName of the maximize icon.
closeButtonPropsButtonPropsnot documentedUsed to pass all properties of the ButtonProps to the Button component.
maximizeButtonPropsButtonPropsnot documentedUsed to pass all properties of the ButtonProps to the Button component.
visiblebooleannot documentedSpecifies the visibility of the dialog.
styleanynot documentedInline style of the component.
position'center' | 'top' | 'bottom' | 'left' | 'right' | 'topleft' | 'topright' | 'bottomleft' | 'bottomright'not documentedPosition of the dialog.
rolestringnot documentedRole attribute of html element.
appendToHTMLElement | 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
property headerTemplate
TemplateRef<void> | undefinednot documentedHeader template.
contentTemplateTemplateRef<void> | undefinednot documentedContent template.
footerTemplateTemplateRef<void> | undefinednot documentedFooter template.
closeIconTemplateTemplateRef<void> | undefinednot documentedClose icon template.
maximizeIconTemplateTemplateRef<void> | undefinednot documentedMaximize icon template.
minimizeIconTemplateTemplateRef<void> | undefinednot documentedMinimize icon template.
headlessTemplateTemplateRef<void> | undefinednot documentedHeadless template.
OutputTypeDescription
onShowEventEmitter<any>Callback to invoke when dialog is shown.
onHideEventEmitter<any>Callback to invoke when dialog is hidden.
visibleChangeEventEmitter<boolean>This EventEmitter is used to notify changes in the visibility state of a component.
onResizeInitEventEmitter<MouseEvent>Callback to invoke when dialog resizing is initiated.
onResizeEndEventEmitter<MouseEvent>Callback to invoke when dialog resizing is completed.
onDragEndEventEmitter<DragEvent>Callback to invoke when dialog dragging is completed.
onMaximizeEventEmitter<any>Callback to invoke when dialog maximized or unmaximized.
Template slotDescription
<ng-template #header>Custom header template.
<ng-template #content>Custom content template.
<ng-template #footer>Custom footer template.
<ng-template #closeicon>Custom close icon template.
<ng-template #maximizeicon>Custom maximize icon template.
<ng-template #minimizeicon>Custom minimize icon template.
<ng-template #headless>Custom headless template.

Inherited from BaseComponent

inherited
InputTypeDefaultDescription
dtObject | undefined undefined Defines scoped design tokens of the component.
unstyledboolean | undefined undefined Indicates whether the component should be rendered without styles.
ptPT | undefined undefined Used to pass attributes to DOM elements inside the component. TRUSTED INPUT ONLY. Whatever you put here is applied to the DOM as given: keys become attributes, and a key that names a DOM property is assigned to that property directly, with no sanitizer in between. That is what makes the API useful, and it means a value reaching it from a user, a database or a CMS can execute script. Treat it like markup you wrote yourself, not like data you received.
ptOptionsPassThroughOptions | undefined undefined Used to configure passthrough(pt) options of the component.