journey.dialog
Dialogs appear as blocking overlays that provides information or confirms destructive behavior. They often prompt users to make a decision.
These docs describe dialogs called from JavaScript/TypeScript. For more fully featured, dynamic dialogs, please refer to the dialog UI component docs. These dialogs are specified from the view XML and can include nested components.
Simple Dialog
Display a dialog with a message and one button.
title
Heading displayed on the dialog
message
Main message displayed in the dialog
okButton
Dialog's OK button. This can either be a string or an object with text and color as fields.
Returns true when clicked.
okButton: "Done"
or
okButton: { text: "Done", color: "positive" }
Example:

journey.dialog.simple({
title: "Success",
message: "You have successfully submitted the form.",
okButton: "Done"
});Confirm Dialog
Display a dialog with a message prompting the user to accept or cancel.
title
Heading displayed on the dialog
message
Main message displayed in the dialog
okButton
Dialog's OK button. This can either be a string or an object with text and color as fields.
Returns true when clicked.
okButton: "Confirm"
or
okButton: { text: "Confirm", color: "positive" }
cancelButton
Dialog's Cancel button. This can either be a string or an object with text and color as fields.
Returns false when clicked.
cancelButton: "Cancel"
or
cancelButton: { text: "Cancel", color: "negative" }
Example:

Input Dialog
Display a dialog with a message and a text-input for simple data entry.
title
Heading displayed on the dialog
message
Main message displayed in the dialog
saveButton
Dialog's Save button. This can either be a string or an object with text and color as fields.
Returns the entered value as a string when clicked.
saveButton: "Save"
or
saveButton: { text: "Save", color: "positive" }
cancelButton
Dialog's Cancel button. This can either be a string or an object with text and color as fields.
Returns undefined when clicked.
cancelButton: "Cancel"
or
cancelButton: { text: "Cancel", color: "negative" }
inputLabel
Label for the input component
inputType
Type of input required from the user. Can be one of the following types (reference: HTML Input Types):
emailnumberparagraphpasswordteltext
text
inputValue
Current value set for the input component
Example:

Error Dialog
Display a dialog with only a message and one button to indicate an error state.
title
Heading displayed on the dialog
message
Main message displayed in the dialog
okButton
Dialog's OK button. This can either be a string or an object with text and color as fields.
Returns true when clicked.
okButton: "Close"
or
okButton: { text: "Close", color: "negative" }
Example:

Styling Options
The style of buttons within these dialogs can be customized as follows.
Example:
Last updated