import { showLoading, showToast, clearAll } from "@wtto00/toast";
const toast = showToast("Hello World!");
// close toast
toast.hide();
// get isHided of toast
console.log(toast.isHided);
const loading = showLoading("Loading...");
// close loading
loading.hide();
// set text of loading
loading.setText("uploading...");
// close all instances of loading
clearAll();
| Name |
Type |
Default |
Description |
| position |
'top'|'center'|'bottom' |
'bottom' for toast, 'center' for loading |
Location of toast |
| theme |
'light'|'dark' |
dark |
Theme of toast |
| timeout |
number |
3s for toast, 0s for loading |
The time of automatic shutdown |
| allowHtml |
boolean |
false |
Whether msg uses HTML strings |
| style |
CSSStyleDeclaration |
undefined |
style of content |