Skip to main content
Use this API to show a brief message that automatically disappears.

Parameters

PropertyTypeRequiredDescription
contentStringNoToast message (required if type is exception)
typeStringNoToast type: success, fail, exception, none (default: none)
durationNumberNoDisplay duration in ms (default: 2000)
successFunctionNoCallback on success
failFunctionNoCallback on failure
completeFunctionNoCallback that always executes

Code Example

// Success toast
my.showToast({
  type: 'success',
  content: 'Saved successfully',
  duration: 2000
});

// Error toast
my.showToast({
  type: 'fail',
  content: 'Operation failed',
  duration: 3000
});

// Plain text toast
my.showToast({
  content: 'Loading complete'
});

my.hideToast

Hide toast

my.showLoading

Show loading indicator