Skip to main content
The toast object is an instance accessible from the main MuPDFWebViewer instance as follows:
const toast = webViewer.toast;
This assumes you have returned your instance name as webViewer from the initMuPDFWebViewer() promise!

toast

The toast object has the following methods:

show

show(config: {
  type: 'success' | 'fail' | 'notification';
  content: string;
  header?: string;
  timeout?: number;
}): Promise<undefined>;
Shows a toast message.

Parameters

config
object
required
Configuration object.

Returns

result
Promise<undefined>
required
A Promise.
Example
webViewer.toast.show({ type: 'success', content: 'Document opened' });