Studio Developer Manual / Version 2210
Table Of ContentsToasts provide feedback, which is triggered by user interaction. Toasts always appear at the bottom left of the screen and disappear automatically after six seconds, but can be disabled in the user preferences dialog. Unlike notifications, they can not be customized. A toast contains a title, a text and has one of the following states: INFO, SUCCESS, WARN or ERROR.
The given code example shows examples how the ToastManager
can be used to display different types of toast messages.
import ToastsManager from "@coremedia/studio-client.ext.toast-components/ToastsManager"; import ValidationState from "@coremedia/studio-client.ext.ui-components/mixins/ValidationState"; //Example: information toast ToastsManager.getInstance().showToastMessage("Hello", "This is a simple message.", null); //Example: success toast ToastsManager.getInstance().showToastMessage("Done!", "The job finished successfully.", ValidationState.SUCCESS); //Example: warning toast ToastsManager.getInstance().showToastMessage("Hint", "Maybe this will not work.", ValidationState.WARN); //Example: error toast ToastsManager.getInstance().showToastMessage("Ups", "Something went wrong.", ValidationState.ERROR);