2.3.1 • Published 4 years ago

toasters v2.3.1

Weekly downloads
23
License
MIT
Repository
github
Last release
4 years ago

toasters

Toast alerts/notifications (initially developed for Vue.js with a material-design style)

Installation

npm install --save --production toasters

Usage

HTML:

<div id="toasts-container" class="position-right position-bottom">
  <div id="toasts-content">
    <!-- toasts will be added or removed from here -->
  </div>
</div>

JS:

import Toast from "toasters";

// example
new Toast({
  content: "Hello World",
  interactable: false
});

// or
new Toast("Hello World");

// or
new Toast("Hello World", { persistent: true, timeout: 9000 });

Preview:

preview of visible toast on webpage

Options

OptionTypeDefaultDescription
contentString""The notification message.
persistentBooleanfalseWhether or not the toast is persistent.
interactableBooleantrueIf the toast can be manually closed or not.
timeoutNumber6000How long till the toast disappears. Note: will be ignored if the toast is persistent.
visibleBooleantrueIf the toast will be visible when instantiated.

Potential future additions

  • Error handling (i.e. you haven't provided any content for the toast)
  • Ability to parse markdown or html

Contributing

# install dependencies
npm install

# watch files for changes with webpack
npm run dev

# build for production with minification
npm run build
2.3.1

4 years ago

2.3.0

4 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.2.3

4 years ago

2.2.2

4 years ago

2.1.2

4 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.1.3

6 years ago