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)