toastit
v2.2.5
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
import {toast} from 'toastit';
toast('Hi');
toast('How is it going?', {
timeoutMs: 5 * 1000, // 5s before it auto closes
leading: true,
});
try {
await toast('Catch me if you can', {
rejectOnPrematureClose: true,
});
} catch {
// prematurely closed
}