This is a submission for the GitHub Finish-Up-A-Thon Challenge
What I Built
toastr-next v3 a complete revival of CodeSeven/toastr, one of the most-starred abandoned JavaScript libraries on GitHub with 12,000+ stars and no meaningful commits since 2016.
toastr was the go-to notification library for millions of developers. But time wasn't kind to it. it required jQuery, had no TypeScript, no dark mode, no accessibility, and its Gulp + LESS build chain was completely dead. It was a library everyone knew but nobody could use in a modern project without guilt.
I picked it up, stripped it to the bones, and rebuilt it from scratch for 2026.
From this ππ»:
// 2015 β drag in jQuery just to show a toast
<script src="jquery.min.js"></script> // 30 KB
<script src="toastr.min.js"></script> // 5 KB
// Total: ~87 KB of dead weight
toastr.success('Hello!');
To this ππ»:
// 2026 β zero dependencies, full TypeScript, ~4 KB gzipped
import { toastr } from 'toastr-next';
const toast = toastr.success('Hello!');
await toast.dismissed; // Promise API!
~4 KB gzipped. No jQuery. No bloat. Just toasts. π
Demo
Dark mode β toasts firing with progress bar
Light mode β same demo, toggled with the βοΈ button
π Live Demo: toastr-next.vercel.app/
π¦ npm: npmjs.com/package/toastr-next
π GitHub: github.com/Divyesh-5981/toastr
The Comeback Story
Where it was

The original repo β abandoned since 2016, 12k stars, zero recent activity
| Problem | Detail |
|---|---|
| jQuery required | ~87 KB overhead just to show a notification |
| No TypeScript | No types, no IntelliSense, no safety |
| No dark mode | Hard-coded colors, no CSS variables |
| No accessibility | Screen readers couldn't detect toasts at all |
| JS-driven animations | Layout thrash, janky on low-end devices |
| No Promise API | No way to await a toast dismissal |
| No keyboard support | Couldn't dismiss with Escape key |
| Dead build toolchain | Gulp + LESS, completely unmaintained since 2016 |
| No ESM support | Global UMD only, no tree-shaking |
What I built
π TypeScript Rewrite (Zero Dependencies)
- No jQuery: 100% strict TypeScript with full JSDoc.
-
Universal Formats: Ships in ESM, CJS, UMD, and IIFE (works from Vite to raw
<script>tags).
π¨ CSS-First Theming
- Modern CSS: Uses CSS variables instead of inline JS styles.
-
Themes & Motion: Auto dark mode (
prefers-color-scheme), manual toggle (localStorage), andprefers-reduced-motionsupport. - Layouts: 4 pure CSS animation presets (Fade, Slide, Bounce, Flip) and native RTL support.
βΏ Full Accessibility (WCAG 2.1 AA)
-
Screen Readers: Dynamic ARIA live regions (
alert/status) and atomic labels. - Keyboard Navigation: Escape key to close, Tab focus management, and pause-on-focus protection.
π Modern API
-
Async & Events: Promises (
await toast.dismissed) and lifecycle event subscriptions (toastr.subscribe). -
DX & Security: Automatic CSS injection (no separate stylesheet import), native React wrapper (
useToastr), and built-in XSS protection.
π¦ Production Ready
- Lightweight: ~4 KB gzipped (~2 KB JS + ~2 KB CSS) vs the original ~87 KB jQuery version.
-
Live: Available on npm as
toastr-nextwith a live Vercel demo.
Size comparison
| toastr v2 (old) | toastr-next v3 | |
|---|---|---|
| Total size | ~87 KB (with jQuery) | ~4 KB gzipped |
| Dependencies | jQuery required | Zero |
| TypeScript | β | β |
| Dark mode | β | β Auto + manual toggle |
| Accessibility | β | β WCAG 2.1 AA |
| Promise API | β | β |
| React support | Third-party only | β Built-in |
| Animations | JS (jQuery) | β CSS @keyframes |
| Bundle formats | Global UMD only | β ESM, CJS, UMD, IIFE |
| CSS import | Required | β Auto-injected |
My Experience with GitHub Copilot
GitHub Copilot (via Kiro) was my co-pilot throughout the entire revival. Here's specifically where it made the difference:
Codebase archaeology β I pointed Copilot at the original toastr source and asked it to map what was worth keeping vs. what needed a full rewrite. It correctly identified that the API surface (success, error, info, warning) was the right thing to preserve for backward compatibility, while everything underneath needed to go.
TypeScript type design β Copilot helped design the ToastrOptions, ToastResponse, and ToastEvent interfaces. The dismissed: Promise<void> pattern β where every toast call returns an awaitable was a Copilot suggestion that turned out to be the most-loved feature of the rewrite.
CSS architecture β The CSS custom properties system for theming was co-designed with Copilot. It suggested the [data-theme] + @media (prefers-color-scheme) layering approach that makes both auto and manual theme switching work correctly without JavaScript.
Accessibility β Copilot flagged that role="alert" should only be used for error/warning toasts (assertive), while info/success should use role="status" (polite) a subtle but important WCAG distinction I would have missed.
CSS auto-injection β When consumers reported having to import the CSS separately, Copilot designed the Vite generateBundle plugin that embeds the stylesheet directly into the JS bundle as a self-executing injector with a guard to prevent double-injection. This was a non-trivial Rollup plugin pattern that Copilot drafted in one shot.
Demo page β The entire index.html demo β stat strip, playground, comparison table, code tabs, custom ARIA dropdown, light/dark toggle was built iteratively with Copilot, including the theme persistence logic and the seamless tab-to-code-block visual connection in light mode.
Working with Copilot felt less like using a tool and more like having a senior developer who knew every API, caught every edge case, and never got tired. The revival that would have taken weeks took days.
Acknowledgements
Huge respect to the original authors β John Papa, Tim Ferrell, and
Hans FjΓ€llemark - who built something so good that developers were still reaching for it a decade later.
This revival exists because their original work was worth finishing β€οΈ


Top comments (8)
Well Explained!
Thanks, man!
Great work man π₯
Thanks so much! π€ Couldn't have done it without GitHub Copilot π€
From 87KB of jQuery guilt to 4KB zero-dep TypeScript β this is exactly the kind of cleanup the ecosystem needed. Well done! π₯
Thank you! It was wild seeing just how much weight we could drop by switching to modern CSS custom properties and native Promises. Zero-dep was the hill I wanted to die on for this rewrite! π―
Excellent write-up and execution.
Thanks a lot! Really appreciate you checking out the write-up. π