npm.io
3.1.51 • Published 4 years ago

mor-mini-toast

Licence
MIT
Version
3.1.51
Deps
0
Size
95 kB
Vulns
0
Weekly
0
DeprecatedThis package is deprecated

Mor Mini Toast for JavaScript

Read the documentation here: https://mohammadrezahq.github.io/mor-mini-toast/

Setup:

Install package with npm:

npm i mor-mini-toast

Import package directly on web page:

<script src="https://unpkg.com/mor-mini-toast/bundle.js"></script>

Import

import MiniToast from 'mor-mini-toast'

// OR

const MiniToast = require('mor-mini-toast')
Initialize
let toast = MiniToast.init(String message, Object options)

// Message will be the text of the toast

// With bundle.js use this:
let toast = window.miniToast.init(String message, Object options)
Set Position
let options = {
    position: 'top-left' // default 
}

The position of the toast should be a combination of a vertical position and - a horizontal position: 'top-left', 'middle-center', 'bottom-right'

Learn more in the documentation

Show the toast
toast.show()

Keywords