A lightweight and simple toast notification library for the browser.
- 🌴 - Three-shakable ESM modules.
- 💬 - Fully typed TSDocs with examples
- ⭐ - No dependencies
- 📁 - Super lightweight (<15kb)
- 🎥 - Simple animations
- ✅ - Simple API and usage
- ⚙️ - Customizable with nice defaults
- 🔵 - Written in TypeScript
Mostly used in basic JavaScript/TypeScript projects where you want a simple toast/snackbar without having external dependencies or a large third-party library.
// import using ESM or CJS
import { toast } from "toastler";
const { toast } = require("toastler");
// Simple defaults
toast("Hello world");
// Highly customizable
toast("Hello world", {
duration: 10000,
type: "error",
animationTiming: 500,
fontSize: "1.5rem"
//...
});
// Simple to remove
const { hide } = toast("Hello world");
hide();
// New toasts will remove old ones
toast("First toast");
setTimeout(() => {
// This toast will hide the first toast before it is showed
toast("Second toast");
}, 2000)