# Boing: animated spring toasts for React

Boing (`react-boing`) is a toast notification library for React. It shows one toast at a time that springs onto the screen, opens into a pill and morphs in place when you update it, with no runtime dependencies and no stylesheet to import.

## Quick start

```bash
npm install react-boing
```

```tsx
import { Toaster, toast } from 'react-boing';

export function App() {
  return (
    <>
      <button type="button" onClick={() => toast.success('Draft saved')}>Save</button>
      <Toaster />
    </>
  );
}
```

## What you get

- Five types: `success`, `error`, `warning`, `info` and `loading`, each with its own drawn icon.
- One toast that changes in place: `toast.update(id, patch)` and `toast.promise(promise, messages)` morph the visible toast instead of stacking new ones.
- Action and undo buttons, progress bars, descriptions, images and a repeat counter.
- Real spring motion you can tune, plus `springEasing` to reuse the same spring in your own CSS or Web Animations.
- Styling through CSS variables, light, dark and system themes, six screen positions and right-to-left support.
- Live-region announcements, keyboard shortcuts, pause on hover and focus, and reduced-motion support built in.
- An optional synthesised chime per toast type.

## Read more

- [Docs](https://boing.aayushbharti.in/docs/): installation, every option, styling, sound and accessibility.
- [Playground](https://boing.aayushbharti.in/playground/): style a toast and copy its CSS.
- [React toast animation](https://boing.aayushbharti.in/react-toast-animation/): how the springs and morphing work.

Source: https://boing.aayushbharti.in/
