Overview
Overview
Section titled “Overview”This package provides a small wrapper that maps typed translation descriptors to Sonner’s toast API using a next-intl translator instance. Instead of passing raw strings you pass an object like { key: 'notifications.saved', type: 'regular', data: { name } }. The wrapper translates that at runtime and forwards the translated string (or rich/markup node) to Sonner.
The design goals:
- Keep Sonner usage ergonomic and typed.
- Use
next-intltranslation features (raw, markup, rich) where needed. - Optional namespace prefixing so all notification keys can live under a single
notificationsnamespace.