3.1.51 • Published 2 years ago
mor-mini-toast v3.1.51
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()