Toasts made simple. Pure JS. React-style. No fluff.
A lightweight, zero-dependency toast notification library inspired by React Hot Toast.
Library developed by Vinay Chaudhary.
๐ GitHub |
โ Support me
Click buttons to trigger toasts:
Include this in your HTML:
<script src="https://cdn.jsdelivr.net/gh/vinayofc/simple-hot-toast/toast.min.js"></script>
toast.success("Success!");
toast.error("Something went wrong.");
toast.loading("Please wait...", { autoCompleteAfter: 3000 });
toast.success(msg, options?)toast.error(msg, options?)toast.loading(msg, options?)toast.custom(html, options?)toast.promise(promise, { loading, success, error }, options?)"top-left" | "top-center" | "top-right"
"bottom-left" | "bottom-center" | "bottom-right"
toast.custom("<strong style='color: green;'>โ
Done!</strong>", {
position: "bottom-center"
});
toast.promise(fetch(url), {
loading: "Loading...",
success: "Done!",
error: "Failed!"
});