Guide
A Sonner alternative with one toast that morphs
Boing is a Sonner alternative for apps that want one toast on screen at a time. Instead of stacking a new card for each message, the visible toast changes shape and text to become the next one, while the calls (toast.success, toast.promise, toast.dismiss) look much the same.
A stack or one toast that morphs
Sonner stacks toasts. Each call adds a card, older cards tuck behind the newest one, and the stack expands when you hover it. That works well when messages are unrelated and the user may want to read several of them.
Boing treats the toast area as one slot. A new message replaces the current one by morphing it: the pill resizes on a spring, the icon redraws and the text rolls over. When the same message arrives twice in a row it shows a ×2 counter instead of a duplicate. Try the buttons above one after another to see it.
If you need some toasts to stay while others come and go, toast.configure({ held: 'list' }) keeps sticky toasts such as errors on screen and lets quick ones appear beside them. See held modes.
How do Sonner calls map to Boing?
Most calls carry over with the same names. The table compares concepts, not internals.
| Sonner | Boing | Notes |
|---|---|---|
<Toaster /> | <Toaster /> | Rendered once. Boing takes position, theme, labels and nonce. |
toast('Hello') | toast.info('Hello') | Boing has no bare call; pick a type or use toast.show(type, title). |
toast.success / error / warning / info / loading | Same names | Title first, options second; each returns an id. |
toast.promise(p, { loading, success, error }) | Same shape | Messages can be strings or functions of the result or error. |
{ description } | { description } | A second line under the title. |
{ action: { label, onClick } } | Same shape | In Boing, returning a patch from onClick morphs the toast. |
Calling again with { id } to update | toast.update(id, patch) | Passing an id that is already on screen also morphs it. |
toast.dismiss(id?) | toast.dismiss(id?) | No id closes every toast. |
| Custom JSX content | No equivalent | Boing renders text, an image, progress and up to two buttons. |
Switching an existing app
- Install
react-boingand render its<Toaster />where the Sonner one was. - Change the imports from
sonnertoreact-boing. - Replace bare
toast('…')calls withtoast.info('…')or the type that fits. - Replace update-by-id calls with
toast.update(id, { type, title }). - Move any custom JSX toasts to text, or keep those few on another component.
When Sonner is the better choice
- You want a visible history of recent toasts, not just the latest one.
- Your toasts hold custom React content.
- You use shadcn/ui and are happy with its Sonner-based toast as it is.
Boing is the better fit when toasts often follow each other in a sequence (saving, saved, undo, restored), when you care about how the motion feels, or when you want sound cues or keyboard access with Alt+T without extra setup.
Frequently asked questions
Can Boing stack toasts like Sonner?
Not as its default. With held: 'list' sticky toasts stay on screen and quick toasts appear beside them, but quick toasts still replace each other.
Is the toast.promise API the same?
The shape is the same: a promise plus loading, success and error messages, where the last two can be functions. Boing returns your promise, so rejections still reach your code.
Does Boing support custom JSX toasts?
No. A toast has a title, an optional description, meta text, an image, a progress bar and up to two buttons. You style it with CSS variables and classes.
Will my Sonner position values work?
Boing accepts the six positions top-left, top-center, top-right, bottom-left, bottom-center and bottom-right.
Related guides
- react-hot-toast alternative with spring physicsSame calls, springier motion.
- shadcn/ui toastFits the shadcn look out of the box.
- React toast animationSprings, morphing in place and reduced motion.
- Boing docsSetup, options, styling, sound and accessibility.