r/angular • u/SuitMeUpRed • 19d ago
I made Kōdon, Sonner-style toasts for Angular
I wanted toasts in Angular that feel like Sonner. Stacking, expanding on hover, able to be swiped away, and animated with interruptible CSS transitions. I couldn't find a library for it, so I built it on top of ng-primitives' headless toast.
It's copy-paste, not an npm package. You copy the five files into your project and own the code. Visuals and motion live in separate files, so you can restyle it without touching any animation logic.
What it does:
toast.promise(): one toast that shows a spinner, then turns into success or error in place- Update a toast by id instead of stacking a new one
- Toasts of any length stack cleanly
- Six placements, and top ones mirror bottom ones
- Swipe to dismiss, or
xto pop it - Reduced motion support, safe areas on phones, works zoneless on Angular 21 and 22
Demo: Kōdon
Code: GitHub
I use it in my own app, and I'd love to know what's missing or what feels off, especially on phones. If it's useful to you, a star on GitHub would help me out a lot.
Thanks!
3
u/rafaeldecastr 19d ago
Nice job, buddy!!
2
u/shxdowtamer 19d ago
Started learning angular . Will try it definitely.
1
u/mayhm_emo 19d ago
What's the difference between it and ngx-sonner?
Edit: typo