xerdi:toast

v0.0.1Published last year

Meteor Toast

Admin-LTE Toasts for MeteorJS.

Installation

Add the package to your project:

meteor add xerdi:toast

Also see xerdi:admin-lte (requirement).

Usage

The toast will by default be placed in .toasts-top-right which is included in xerdi:admin-lte. To change that you can set Toast.containerSelector to your container.

To show a toast, you can do the following:

1const toast = new Toast({
2    title: 'My Title',
3    icon: 'fas fa-icons',
4    image: '/path/to/image',
5    defaultAction: '/myMessages',
6    createdAt: new Date(),
7    close: false,
8    body: 'Hi <b>there</b>!',
9    class: 'bg-danger'
10});
11
12toast.show();
13toast.hide();

The toast will be destroyed when hidden.