Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 715 Bytes

File metadata and controls

44 lines (32 loc) · 715 Bytes

Toast component

Basic toast component for marionette

Usage

Instantiation

Simply pass in an initialization option object with an optional className (To provide custom styling)

import Toast from "@vokke/toast";

this.toast = new Toast({
    className: "helloWorld"
});

Showing

Showing the toast, you just call .show() on it

this.toast.show({
    message: "Hello world",
    timeout: 4500
});

Events

The only event so far is a click on the whole toast, To bind to this, use the following.

this.listenTo(this.toast, "click:toast", e => {
    console.log(e);
});

// or

this.toast.on("click:toast", e => {
    console.log(e);
});

TODO

  • Setup the build process