Skip to content

Toast

Available since Shopware v6.6.2.0

Toasts display short, temporary messages to provide feedback about user actions or system events. Unlike notifications, which persist in the notification center until dismissed, toasts disappear automatically after a short time.

See also: Base Options for shared configuration options supported by SDK message APIs.

toast.dispatch()

toast example

Usage

ts
import { toast } from "@shopware-ag/meteor-admin-sdk";

function alertYes() {
  alert("Yes");
}

toast.dispatch({
  msg: "Your message",
  dismissible: true,
  type: "positive",
  action: {
    label: "action",
    callback: alertYes,
  },
});

Parameters

NameRequiredDefaultDescription
msgtrueDefines a toast's main expression or message to the user.
typetrueDefines the toast type. Available types are positive, informal and critical.
iconfalseNoneAn icon that should be displayed in front of your message.
dismissiblefalsefalseSpecifies if the toast can be manually dismissed.
actionfalseNoneAdds a clickable button to the toast. The button receives a label and a callback which is called once clicked.

Return value

Returns a promise without data.

Was this page helpful?
UnsatisfiedSatisfied
Be the first to vote!
0.0 / 5  (0 votes)