handy-toast

1.1.7 • Public • Published

handy-toast is a html toast component which written in javascript

Example

// in the main.js file
// import
import HandyToast from 'handy-toast'
// create an instance
const instance = new HandyToast()
// initialize
instance.init()

Configuration

// configuration
const config = {
    isAutoDisappear: true, // default
    disappearInTime: 15000, // default (ms)
    maxToastNumber: 5 // default
}

const instance = new HandyToast(config)

Usage

// three types of toast:
// Success type
window.$toast.success('This is a success message', 'Success')
// Warning type
window.$toast.info('This is a info message', 'Info')
// Error type
window.$toast.error('This is an error message', 'Error')

Output

Output

Package Sidebar

Install

npm i handy-toast

Weekly Downloads

0

Version

1.1.7

License

MIT

Unpacked Size

57.8 kB

Total Files

14

Last publish

Collaborators

  • eli_xi