Skip to main content

Dialog API

Properties
NameTypeDefaultDescription
headlinestringTitle displayed in the dialog header.
no-keysbooleanfalseDisables the Escape key so the dialog cannot be closed with it.
no-closebooleanfalseDisables all close interactions (X button, backdrop click, Escape key).
localbooleanfalseOpens the dialog inside its parent container instead of overlaying the full page.
widthstringWidth of the dialog in any CSS unit. Must be set before opened if both are used together.
heightstringHeight of the dialog in any CSS unit.
min-heightstringMinimum height of the dialog in any CSS unit.
preventClosebooleanfalseWhen true, the dialog cannot be closed by any means.
openedbooleanfalseControls the open/closed state of the dialog.
no-paddingbooleanfalseRemoves padding from the content area.
footer-closebooleanfalseAdds a close button to the footer automatically.
JavaScript API
NameKindDescription
open([options])actionOpens the dialog. Accepts any dialog property as an option, plus an opener element reference to return focus to on close.
close()actionCloses the dialog.
setContent(html | domNode)actionReplaces the dialog content while open. Original content is restored on close.
setHeader(html | domNode)actionAppends a secondary header while open. Original header is restored on close.
setSize({ width, height, minHeight })actionSets dialog dimensions to the given CSS values. Height includes header + content + footer.
Events
EventDescriptionReturns
dialog.openFires when the dialog opens.{ detail: { component } }
dialog.closeFires when the dialog closes.{ detail: { component } }
dialog.beforeCloseFires before the dialog closes.{ detail: { component } }