npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-next-toast

v2.0.2

Published

An easy to use library for toast notifications

Downloads

208

Readme

react-next-toast

📦 Introducing react-next-toast 🍞

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

🚀 Why Choose react-next-toast??

  • Easy to use: 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.
  • Customizable: With our Four (4) different types of Toast Notifications - Success, Error, Warning and Info, you get a fine-tuned and different UI display for each which directly passes message from the choice of colour and design. It also provides option to choose duration of toasts, colours and fonts.
  • Lightweight: Designed with performance in mind as well, the package is designed to lightweight in other to ensure it does not slow down your app's performance.
  • Fully-typed: react-next-toast comes with TypeScript support out of the box to provide type safety and seamless renderings.

📝 How to Use:

  1. Install the package into your project
npm install react-next-toast
  1. Import the 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;

Demo

react-next-toast-demo-gif

CodeSandbox

Code Sandbox Environment

💡 Additional Features

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)
}

NOTE: For more advanced customization, you can directly use the ToastNotification component and pass in the required props - duration, position, className.

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! _🥂