toastr-next

The legendary notification library revived. Zero dependencies. TypeScript. CSS animations. Dark mode. ARIA.

βœ“ Zero dependencies v3.0.7 MIT License WCAG 2.1 AA TypeScript Dark mode auto
npm install toastr-next
~4 KB
minified + gzipped
0
dependencies
4
animation styles
8
positions
0
toasts fired here

πŸš€ Quick fire Try it

πŸŽ› Playground Configure

✨ Animation showcase 4 styles

πŸ“Š Before & after The revival

toastr v2 (old)
87 KB (jQuery + toastr)
toastr-next v3
~4 KB gzipped

βœ• toastr v2 (2015)

  • βœ• Requires jQuery (~87 KB overhead)
  • βœ• JS-driven animations (layout thrash)
  • βœ• No dark mode
  • βœ• No TypeScript types
  • βœ• Inaccessible (screen readers blind)
  • βœ• No ESM / tree-shaking
  • βœ• Gulp + LESS (abandoned toolchain)
  • βœ• No Promise API
  • βœ• No keyboard support
  • βœ• PNG sprite icons (extra HTTP request)

βœ“ toastr-next v3 (2026)

  • βœ“ Zero dependencies β€” pure vanilla JS
  • βœ“ CSS @keyframes β€” buttery smooth
  • βœ“ Auto dark mode via prefers-color-scheme
  • βœ“ Full TypeScript types + JSDoc
  • βœ“ ARIA live regions, roles, keyboard nav
  • βœ“ ESM + CJS + IIFE bundles
  • βœ“ Vite build + Vitest tests
  • βœ“ Promise API (await toast.dismissed)
  • βœ“ Escape key + focus management
  • βœ“ CSS pseudo-element icons (no images)

πŸ’» Code samples Drop-in API

Bundler (TS)
CDN (HTML)
React
Basic API
Options
Promise API
Migration
// 1. Install
npm install toastr-next

// 2. src/main.ts β€” entry file (same code works under Vite, Webpack,
//    Rollup, Parcel, esbuild. No special bundler config needed.)
import { toastr } from 'toastr-next';
// CSS is auto-injected on first import β€” no `import 'toastr-next/style'`.

toastr.options = {
  positionClass: 'toast-top-right',
  progressBar: true,
  closeButton: true,
  timeOut: 4000,
};

document.getElementById('save')!.addEventListener('click', async () => {
  const t = toastr.info('Saving…', '', { timeOut: 0 });
  try {
    await saveToServer();
    t.clear();
    await t.dismissed;
    toastr.success('Saved!');
  } catch {
    t.clear();
    toastr.error('Save failed');
  }
});

// 3. index.html (Vite-style)
// <button id="save">Save</button>
// <script type="module" src="/src/main.ts"></script>