Skip to content

@serenity-is/corelib / DialogOptions

Interface: DialogOptions

Defined in: src/base/dialogs.tsx:56

Options that configure a Dialog instance across all providers.

Remarks

The dialog provider is chosen automatically from DialogOptions.preferPanel, DialogOptions.preferBSModal, and feature detection (hasBSModal() / hasUIDialog()). Provider-specific options can be injected via DialogOptions.providerOptions.

Extended by

Properties

autoDispose?

optional autoDispose: boolean

Defined in: src/base/dialogs.tsx:58

When true, Dialog.dispose is called automatically on close.

Default Value

true


autoOpen?

optional autoOpen: boolean

Defined in: src/base/dialogs.tsx:60

When true, the dialog opens immediately after construction.

Default Value

true


backdrop?

optional backdrop: boolean | "static"

Defined in: src/base/dialogs.tsx:62

Backdrop behavior for Bootstrap modals; "static" prevents closing on outside click.

Default Value

false


buttons?

optional buttons: DialogButton[]

Defined in: src/base/dialogs.tsx:64

Buttons rendered in the dialog footer.


centered?

optional centered: boolean

Defined in: src/base/dialogs.tsx:70

Vertically centers a Bootstrap modal via modal-dialog-centered. When false, the modal is anchored at the --s-modal-top theme token, so it grows downwards instead of moving as its content changes; combine with scrollable to scroll its body once it reaches the bottom of the viewport.

Default Value

true


closeButton?

optional closeButton: boolean

Defined in: src/base/dialogs.tsx:72

Whether to render the header close (× / btn-close) button.

Default Value

true


closeOnEscape?

optional closeOnEscape: boolean

Defined in: src/base/dialogs.tsx:74

Whether pressing Escape closes the dialog. Message dialogs default to true.


dialogClass?

optional dialogClass: string

Defined in: src/base/dialogs.tsx:76

Extra CSS class(es) added to the root dialog element (.modal, .ui-dialog, or .s-Panel).


element?

optional element: HTMLElement | ArrayLike<HTMLElement> | (element) => void

Defined in: src/base/dialogs.tsx:78

Body element or a callback that populates the freshly created body element. Array-like values are treated as the content node.


fade?

optional fade: boolean

Defined in: src/base/dialogs.tsx:80

Enables fade animation for Bootstrap modals.

Default Value

false for message dialogs, true otherwise


fullScreen?

optional fullScreen: boolean | "sm-down" | "md-down" | "lg-down" | "xl-down" | "xxl-down"

Defined in: src/base/dialogs.tsx:90

Applies a modal-fullscreen[-{breakpoint}-down] class. Only effective for Bootstrap modals.


height?

optional height: "auto" | "md" | "lg" | "full"

Defined in: src/base/dialogs.tsx:88

Fixed height of a Bootstrap modal: "md" and "lg" take the --s-modal-height-md and --s-modal-height-lg theme tokens, "full" the height of the viewport. A modal with a fixed height keeps its size and position while its content changes, and its body scrolls. The height is capped to the viewport, and a fullscreen modal keeps its full height. "auto", or leaving it unset, sizes the modal to its content. Only effective for Bootstrap modals.

Default Value

undefined (auto)


optional modal: boolean

Defined in: src/base/dialogs.tsx:92

jQuery UI modal flag. Retained for backward compatibility; does not affect Bootstrap modals.


onClose()?

optional onClose: (result, e?) => void

Defined in: src/base/dialogs.tsx:96

Callback invoked after the dialog is closed, receiving the result code.

Parameters

result

string

e?

Event

Returns

void


onOpen()?

optional onOpen: (e?) => void

Defined in: src/base/dialogs.tsx:94

Callback invoked after the dialog is opened.

Parameters

e?

Event

Returns

void


preferBSModal?

optional preferBSModal: boolean

Defined in: src/base/dialogs.tsx:98

When both providers are available, prefer Bootstrap modal over jQuery UI dialog.

Default Value

true


preferPanel?

optional preferPanel: boolean

Defined in: src/base/dialogs.tsx:100

Force inline panel mode even when modal / jQuery UI providers are available.


providerOptions()?

optional providerOptions: (type, opt) => any

Defined in: src/base/dialogs.tsx:102

Returns provider-specific options merged into the underlying call (Bootstrap modal options or jQuery UI dialog options).

Parameters

type

DialogProviderType

Resolved provider type.

opt

DialogOptions

The resolved dialog options.

Returns

any

Provider-specific options object.


scrollable?

optional scrollable: boolean

Defined in: src/base/dialogs.tsx:104

Makes the Bootstrap modal body scrollable via modal-dialog-scrollable.


size?

optional size: "md" | "lg" | "sm" | "xl"

Defined in: src/base/dialogs.tsx:106

Bootstrap modal size.

Default Value

"lg" for regular dialogs, "md" for message dialogs


title?

optional title: string

Defined in: src/base/dialogs.tsx:108

Title text shown in the dialog header.


width?

optional width: number

Defined in: src/base/dialogs.tsx:110

Initial width in pixels; only used by the jQuery UI dialog provider.