Toasts with real spring physics.
Ding is a toast notification library. Only one toast is on screen at a time, and a new call morphs it in place instead of stacking. No dependencies, MIT licensed. Works with React, Svelte 5, Vue 3 and plain JavaScript.
Install
- React:
npm i @yusufceng1z/ding-react - Svelte 5:
npm i @yusufceng1z/ding-svelte - Vue 3 and Nuxt:
npm i @yusufceng1z/ding-vue - Plain JavaScript:
npm i @yusufceng1z/ding - shadcn/ui registry:
npx shadcn@latest add @ding/ding
Why Ding
- Real springs: size, shape and text move on a spring solver, so interrupting an animation keeps its momentum.
- No stylesheet to import and no dependencies. Styles are injected from JavaScript.
- Light, dark and system themes, six positions and right-to-left support.
- Colors and corner radius are CSS variables, so it is easy to restyle.
- Rich content: description, avatar, buttons, progress bar, countdown line and small trailing text.
- Accessible by default: live regions, keyboard dismiss and
prefers-reduced-motion.
Guides
- React toast notifications and Next.js
- Svelte 5 toast notifications
- shadcn/ui toast
- JavaScript toast notifications without a framework
- Sonner alternative, react-hot-toast alternative and svelte-sonner alternative
- Loading toast and undo toast
- Toast notification UX, toast vs snackbar and accessible toast notifications
- Playground: style a toast and copy the CSS
Read the docs · What's new · Source on GitHub · npm · llms.txt