@serenity-is/corelib / DialogButton
Interface: DialogButton
Defined in: src/base/dialogs.tsx:17
Options that describe a single button rendered in a Dialog footer.
Remarks
Buttons are rendered as Bootstrap btn or jQuery UI button elements depending
on the active dialog provider. When DialogButton.result is set and the
click handler does not cancel the event, the dialog automatically closes with
that result code.
Properties
click()?
optionalclick: (e) =>false|void|Promise<false|void>
Defined in: src/base/dialogs.tsx:29
Click handler invoked when the button is activated.
Parameters
e
MouseEvent
The originating mouse event.
Returns
false | void | Promise<false | void>
false to prevent the automatic close, or a Promise that resolves to false to cancel asynchronously.
cssClass?
optionalcssClass:string
Defined in: src/base/dialogs.tsx:31
Additional CSS class(es) added to the button element (e.g. "btn-primary", "btn-danger").
hint?
optionalhint:string
Defined in: src/base/dialogs.tsx:21
Tooltip / title attribute shown on hover.
icon?
optionalicon:IconClassName
Defined in: src/base/dialogs.tsx:23
Optional icon displayed before the text; resolved via iconClassName.
result?
optionalresult:string
Defined in: src/base/dialogs.tsx:37
Result code assigned to the dialog when this button is clicked.
The value is stored in dataset.dialogResult and passed to onClose handlers.
If set and the click handler does not call preventDefault() / return false, the dialog closes automatically.
text?
optionaltext:string
Defined in: src/base/dialogs.tsx:19
Visible caption rendered inside the button. Defaults to a localized value when created via helper factories.