![]() |
4 years ago | |
---|---|---|
dist | 4 years ago | |
example | 4 years ago | |
src | 4 years ago | |
.babelrc | 5 years ago | |
.gitignore | 5 years ago | |
.npmignore | 5 years ago | |
LICENCE.md | 4 years ago | |
README.md | 4 years ago | |
package-lock.json | 4 years ago | |
package.json | 4 years ago | |
webpack.config.js | 4 years ago |
Toast alerts/notifications (initially developed for Vue.js with a material-design style)
npm install --save --production toasters
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";
new Toast(options);
// example
new Toast({
content: "Hello World",
persistent: true
});
Preview:
Option | Type | Default | Description |
---|---|---|---|
content |
String | "" |
The notification message. |
persistent |
Boolean | false |
Whether or not the toast is persistent. |
interactable |
Boolean | true |
If the toast can be manually closed or not. |
timeout |
Number | 6000 |
How long till the toast disappears. Note: will be ignored if the toast is persistent. |
# install dependencies
npm install
# watch files for changes with webpack
npm run dev
# build for production with minification
npm run build