Include script.js
and style.css
in your html
toast.success("Success message");
toast.error("Error message");
toast.info("Simple message");
toast.promise(promise, {
success: "Promise resolved",
error: "Promise rejected",
loading: "Waiting for promise",
});
toast.updateStyles({
red: {
text: "#FFFFFF",
bg: "#D45454",
border: "",
},
green: {
text: "#FFFFFF",
bg: "#2FE075",
border: "",
},
other: {
text: "#FFFFFF",
bg: "#3F3F3F",
border: "",
},
});
toast.setPosition("top", "left");
toast.reverseOrder = true; // Most recent toasts will be on top
toast.reverseOrder = false; // Most recent toasts will be on bottom
toast.icons = {
info: "<svg></svg>",
success: "<svg></svg>",
errror: "<svg></svg>",
loading: "<svg></svg>",
};