Menu

I made Kōdon, Sonner-style toasts for Angular
📰

I made Kōdon, Sonner-style toasts for Angular

#angular#redditangular#toast#toasts#stacking
Reading 0:00
15s threshold

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 x to 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.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.