Toast-style Temporary Notification Library – ice-toast

Category: Javascript , Notification | November 26, 2018
Author: coinchasedev
Views Total: 236
Official Page: Go to website
Last Update: November 26, 2018
License: MIT

Preview:

Toast-style Temporary Notification Library – ice-toast

Description:

Just another dependency-free JavaScript library that provides toast-style temporary alerts and messages for your web app.

How to use it:

Insert the JavaScript file ice-toast.js into the html file.

<script src="./ice-toast.js"></script>

Create a basic toast notification.

iceToast.push( 'A message' )

Change the position of the toast notification.

iceToast.push({
  words: 'A message'
  position: 'top-center' // or 'top-right'
})

Set the timeout in milliseconds.

iceToast.push({
  words: 'A message'
  time: 5000 // default: 4000
})

Change the default styles of the toast notification.

iceToast.push({
  words: 'A message'
  colors:{
    'dark': 'rgba(50,50,50,0.9)',
    'green': '#22B14C',
    'blue': '#00A2E8',
    'red': '#ED1C24',
    'orange': '#FF7F27',
  }
})

Reposition the toast notification if needed.

iceToast.setPosition('top-right')

iceToast.setPosition('top-center')

You Might Be Interested In:


Leave a Reply