An easy to use notification system package for your React/Next.js Web Apps
MIT License
Tired of dealing with complex notification packages or having to spend time building components just to render alerts or toast notificaitons in your React projects? Look no further! Here, I introduce react-next-toast
react-next-toast
was built with ease in mind - say goodbye to complex toast declarations - with react-next-toast you have a toast via a single function call.react-next-toast
comes with TypeScript support out of the box to provide type safety and seamless renderings.npm install react-next-toast
showToast
& use in your Component:import { showToast } from 'react-next-toast';
const MyComponent = () => {
const handleClick = () => {
showToast.success('Log in successful')
}
return (
<div>
<h1>Hello Dev</h1>
<button onClick={handleClick}>Log in</button>
</div>
);
}
export default MyComponent;
You can customize the duration
of the Toast Notification by passing time in ms
as second parameter to the showToast
function.
The default is 5000
which is 5 seconds.
const handleClick = () => {
showToast.error('incorrect login details', 4000)
}
Project is OPEN SOURCE! Feel free to fork the repo and send a PR to contribute. I will be sure to merge if its a good piece. Thank you
Thank you for using `react-next-toast! 🙏❤️ If you experience any issue, have any questions or sugestions for improvement, feel free to raise an issue here on GitHub or reach out to me. Your feedback is very vital! ☺:)
Cheers to toasting to simpler and delightful notes! 🥂