toastit
v2.2.2
Published
Utility function to toast a message at the bottom of the page with timing feature.
Readme
toastit
Utility function to toast a message at the bottom of the page with timing feature.
Note: It's using @material/mwc-snackbar in the background.
Installation
npm i -D toastitUsage
In your HTML (from CDN)
<script src="https://unpkg.com/toastit@latest/dist/toastit.min.js"></script>
<script>
toast("hello")
</script>In your ESM code
import {toast} from 'toastit';
toast('Hello');
toast('How is it going?', {leading: true, timeoutMs: 1000 * 5}); // 5s before it auto closesYou can also use the minified version of esm if you just want to test something (but not recommended for production)
import {toast} from 'toastit/min'
...