Display Unobtrusive Toast Messages With ttoast.js

Category: Javascript , Notification | June 15, 2023
Author:togihon
Views Total:216 views
Official Page:Go to website
Last Update:June 15, 2023
License:MIT

Preview:

Display Unobtrusive Toast Messages With ttoast.js

Description:

ttoast.js is a lightweight and fast JavaScript alert/notification library that displays unobtrusive toast-like messages to users.

How to use it:

1. Download and import the ttoast.js into the document.

<script src="ttoast.js"></script>

2. Display a basic toast message on the page.

TToast({
  text: 'Your message',
})

3. You have the flexibility to place the toast messages at any location on your webpage: [top, middle, bottom]|[left, center, right].

TToast({
  text: 'Your message',
  position: 'bottom|center',
})

4. Add a custom icon (as CSS classes) to the toast message.

TToast({
  text: 'Your message',
  icon: 'fas fa-check',
})

5. Customize the toast messages.

TToast({
  text: 'Your message',
  fontsize: 'large', // small, normal, large
  color: '#fff',
  background: '#000',
})

You Might Be Interested In:


Leave a Reply