# Sonner alternative that shows one toast at a time

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](https://boing.aayushbharti.in/docs/#held).

## 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

1. Install `react-boing` and render its `<Toaster />` where the Sonner one was.
2. Change the imports from `sonner` to `react-boing`.
3. Replace bare `toast('…')` calls with `toast.info('…')` or the type that fits.
4. Replace update-by-id calls with `toast.update(id, { type, title })`.
5. Move any custom JSX toasts to text, or keep those few on another component.

```ts
import { toast } from 'react-boing';

const id = toast.loading('Uploading…');
await upload(file);
toast.update(id, { type: 'success', title: 'Uploaded' });
```

## 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 <kbd>Alt</kbd>+<kbd>T</kbd> 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 physics](https://boing.aayushbharti.in/react-hot-toast-alternative/): Same calls, springier motion.
- [shadcn/ui toast](https://boing.aayushbharti.in/shadcn-toast/): Fits the shadcn look out of the box.
- [React toast animation](https://boing.aayushbharti.in/react-toast-animation/): Springs, morphing in place and reduced motion.
- [Boing docs](https://boing.aayushbharti.in/docs/): Setup, options, styling, sound and accessibility.

Source: https://boing.aayushbharti.in/sonner-alternative/
