node package manager
Painless code sharing. npm Orgs help your team discover, share, and reuse code. Create a free org »

show-toast

show-toast

Build Status npm npm npm npm

Overview

A Toast Box

Install

Install show-toast

npm install show-toast

Import show-toast

ES6/commonjs import style is supported.

// ES6
import showToast from 'show-toast';
 
// commonjs
var showToast = require("show-toast");

or link as a script in an html file and access global variable showToast.

<script src="dist/show-toast.js"></script>

Usage

showToast({
  str: 'this is a success toast box'
  type: 'success',
  time: 2000
})
 
showToast({
  str: 'this is an error toast box'
  type: 'error',
  time: 2000
})

options

Option Description
str String(default: '') toast text content
type String(default: 'success') type of the toast
time Number(defalut: 2000) time duration

LICENSE

MIT@PLDaily