react-notifications, react-s-alert, and react-toastify are React libraries designed to display transient user feedback messages—such as success confirmations, warnings, or errors—without interrupting the user’s workflow. These packages abstract away the complexity of managing DOM insertion, animation timing, stacking behavior, and dismissal logic, allowing developers to trigger notifications declaratively from anywhere in their application.
When you need to show temporary messages in a React app—like “Settings saved” or “Network error”—you quickly realize that rolling your own solution leads to messy state management, inconsistent styling, and poor accessibility. Dedicated notification libraries solve this by handling rendering, lifecycle, and UX polish. Let’s compare three popular options.
Before diving into features, check whether a library is still alive.
react-notifications is deprecated. Its GitHub repo is archived, and the npm page states: “This package is no longer maintained.” Do not use it in new projects.
// ❌ Avoid — deprecated and unmaintained
import { Notifications, notify } from 'react-notifications';
function App() {
return (
<>
<button onClick={() => notify('Hello', 'success')}>Show</button>
<Notifications />
</>
);
}
react-s-alert hasn’t seen significant updates since 2018. While not officially deprecated, its GitHub repo shows no recent commits, and issues remain unanswered. Use with caution.
react-toastify is actively maintained, with regular releases, TypeScript support, and responsive issue triage. This matters for security patches, React version compatibility, and new platform features (like focus management).
All three follow a similar pattern: include a container component once, then call a function elsewhere.
react-notifications (deprecated):
// ❌ Deprecated example
import { Notifications, notify } from 'react-notifications';
function App() {
return (
<>
<button onClick={() => notify('Item deleted', 'error', 3000)}>Delete</button>
<Notifications />
</>
);
}
react-s-alert:
// ✅ Still works, but aging
import SAlert from 'react-s-alert';
import 'react-s-alert/dist/s-alert-default.css';
function App() {
return (
<>
<button onClick={() => SAlert.error('Failed to save', { timeout: 4000 })}>
Save
</button>
<SAlert stack={{ limit: 3 }} />
</>
);
}
react-toastify:
// ✅ Modern, clean API
import { ToastContainer, toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
function App() {
return (
<>
<button onClick={() => toast.error('Failed to save', { autoClose: 4000 })}>
Save
</button>
<Toast-container position="top-right" />
</>
);
}
Note how react-toastify uses consistent naming (toast.error) and separates concerns: the container configures global behavior, while individual calls set per-notification options.
Need branded colors, custom icons, or interactive buttons inside notifications?
react-notifications offers almost no theming—just basic type-based classes.
react-s-alert lets you override CSS and inject JSX content:
SAlert.info(
<div>
<strong>New message!</strong>
<button onClick={handleReply}>Reply</button>
</div>,
{ customFields: { myClass: 'custom-alert' } }
);
But you’re on your own for styling and accessibility.
react-toastify shines here. You can pass JSX directly, use render props, or even create fully custom components:
toast.success(
<div style={{ display: 'flex', alignItems: 'center' }}>
<CheckIcon />
<span>Profile updated</span>
</div>
);
// Or use a custom component
const UpdateNotice = ({ closeToast }) => (
<div>
Data synced!
<button onClick={closeToast}>Dismiss</button>
</div>
);
toast(<UpdateNotice />);
It also supports dark mode out of the box via CSS variables or theme prop.
Notifications must be screen-reader friendly and work on touch devices.
react-notifications and react-s-alert do not implement ARIA live regions properly, meaning screen readers may miss alerts.
react-toastify includes role="alert" and aria-live="assertive" by default, ensuring assistive technologies announce messages. It also supports:
<ToastContainer
pauseOnFocusLoss={false}
pauseOnHover={true}
draggable={true} // enables swipe on mobile
/>
What if you want to show “Saving…” → “Saved!” or “Error” based on a fetch result?
react-notifications and react-s-alert require manual state management:
// With react-s-alert
SAlert.info('Saving...', { id: 'save' });
api.save()
.then(() => {
SAlert.close('save');
SAlert.success('Saved!');
})
.catch(() => {
SAlert.close('save');
SAlert.error('Failed');
});
react-toastify simplifies this with toast.promise():
// Clean and declarative
toast.promise(
api.save(),
{
pending: 'Saving...',
success: 'Saved!',
error: 'Failed to save'
}
);
It automatically replaces the pending toast with success/error based on the promise outcome.
react-notifications uses outdated patterns (no hooks, class components only).
react-s-alert works with hooks but doesn’t leverage them.
react-toastify provides a useToast hook for programmatic control and plays well with Context, Suspense, and concurrent rendering.
// Using the hook
function MyComponent() {
const toast = useToast();
const handleClick = () => toast('Hello from hook!');
return <button onClick={handleClick}>Notify</button>;
}
react-notifications — it’s deprecated.react-s-alert unless you’re maintaining an old project or specifically need its animation integrations.react-toastify for all new projects. It’s the only one that’s actively maintained, accessible, customizable, and aligned with modern React best practices.In short: if you’re starting today, there’s really only one serious choice.
Choose react-toastify for new projects requiring a robust, actively maintained notification system with strong defaults, extensive customization, and full accessibility compliance. It provides built-in support for promise resolution tracking, swipe-to-dismiss on mobile, auto-close controls, and theming via CSS variables or styled-components. Its API is intuitive for both simple and complex use cases, and it integrates cleanly with modern React patterns like hooks and context.
Choose react-s-alert if you need fine-grained control over animation transitions using Velocity.js or GSAP and require custom layout behaviors like stacking direction or offset adjustments. It supports both functional and component-based invocation styles and allows per-alert configuration. However, be aware that development has slowed significantly, with minimal recent activity on GitHub. Use it only if your project already depends on it or if you specifically need its animation integration.
Avoid react-notifications in new projects—it is deprecated and no longer maintained. The GitHub repository is archived, and the npm package page explicitly warns against its use. While it once offered basic notification types and positioning, it lacks modern features like promise-based dismissal, accessibility support, or TypeScript definitions. Only consider it if maintaining a legacy codebase where migration isn’t feasible.

🎉 React-Toastify allows you to add notifications to your app with ease.
$ npm install --save react-toastify
$ yarn add react-toastify
import React from 'react';
import { ToastContainer, toast } from 'react-toastify';
function App(){
const notify = () => toast("Wow so easy!");
return (
<div>
<button onClick={notify}>Notify!</button>
<ToastContainer />
</div>
);
}
Check the documentation to get you started!
onOpen and onClose hooks. Both can access the props passed to the react component rendered inside the toastnprogress 😲A demo is worth a thousand words
Show your ❤️ and support by giving a ⭐. Any suggestions are welcome! Take a look at the contributing guide.
You can also find me on reactiflux. My pseudo is Fadi.
This project exists thanks to all the people who contribute. [Contribute].
Become a financial contributor and help us sustain our community. [Contribute]
Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]
You can find the release note for the latest release here
You can browse them all here
Licensed under MIT