A simple javascript library for displaying toast notifications. This library doesn't have any dependencies and can be used with any webpage.
You can view a demo here
https://cdn.jsdelivr.net/gh/FaisalST32/fs-toast@latest/src/js/toastfs.min.js
https://cdn.jsdelivr.net/gh/FaisalST32/fs-toast@latest/src/css/toastfs.min.css
npm i fs-toast
https://www.npmjs.com/package/fs-toast
-
To use the library you can simply add a reference to the .js file at the end of the body of your html and the .css file in the head of your html page.
-
To display a toast notification, use the following methods.
The plugin exposes these methods that you can use:
-
toastfs.success('message') - This will display a success toast with the provided message
-
toastfs.error('message') - This will display an error toast with the provided message
-
toastfs.remove() - This will remove any toast that might be displayed.