1.0.2 • Published 3 years ago

toast-js-insideo v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

JS Toast Notification

Yet another JS Toast notification plugin.

Installation

# yarn
yarn add toast-js-insideo

# npm
npm install toast-js-insideo

Usage

const toast = new Toast({
    text: "This is my favorite Toast message component",
    position: "top-right",
    messageType: "success",
    pauseOnHover: true,
    autoClose: 3000,
    pauseOnFocusLoss: true,
})

Available options

The API methods accepts these options:

AttributeTypeDefaultDescription
textString--Message text/html (required)
typeStringsuccessOne of success, info, warning, error, default
positionStringbottom-rightOne of top, bottom, top-right, bottom-right,top-left, bottom-left
durationNumber3000Visibility duration in milliseconds, set to 0 to keep toast visible
dismissibleBooleantrueAllow user dismiss by clicking
onClickFunction--Do something when user clicks
onDismissFunction--Do something after toast gets dismissed
queueBooleanfalseWait for existing to dismiss before showing new
pauseOnHoverBooleantruePause the timer when mouse on over a toast

Run examples on your localhost

  • Clone this repo
  • Make sure you have node-js >=12.15 and yarn >=1.22 pre-installed
  • Install dependencies - yarn install
  • Run webpack dev server - yarn start
  • This should open the demo page at http://localhost:9000 in your default web browser

License

MIT License

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago