The options used to create a dialog.

interface IOptions<T> {
    body: Body<T>;
    buttons: readonly IButton[];
    checkbox: null | Partial<ICheckbox>;
    defaultButton: number;
    focusNodeSelector: string;
    hasClose: boolean;
    host: HTMLElement;
    renderer: Dialog.IRenderer;
    title: Header;

Type Parameters

  • T


body: Body<T>

The main body element for the dialog or a message to display. Defaults to an empty string.


If a widget is given as the body, it will be disposed after the dialog is resolved. If the widget has a getValue() method, the method will be called prior to disposal and the value will be provided as part of the dialog result. A string argument will be used as raw textContent. All input and select nodes will be wrapped and styled.

buttons: readonly IButton[]

The buttons to display. Defaults to cancel and accept buttons.

checkbox: null | Partial<ICheckbox>

The checkbox to display in the footer. Defaults no checkbox.

defaultButton: number

The index of the default button. Defaults to the last button.

focusNodeSelector: string

A selector for the primary element that should take focus in the dialog. Defaults to an empty string, causing the [[defaultButton]] to take focus.

hasClose: boolean

When "false", disallows user from dismissing the dialog by clicking outside it or pressing escape. Defaults to "true", which renders a close button.

The host element for the dialog. Defaults to document.body.

renderer: Dialog.IRenderer

An optional renderer for dialog items. Defaults to a shared default renderer.

title: Header

The top level text for the dialog. Defaults to an empty string.