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-notificantion-toast

v1.0.10

Published

<!-- # React + JavaScript + Vite

Downloads

12

Readme

React + JavaScript + Vite

  • react-notificantion-toast

React Notificantion Toast with Progressbar.

NPM Version License

A brief description of my package and its key features.

Installation

You can install this package via npm. Run the following command:

  • Using Node Package Manager (NPM)
npm i react-notificantion-toast
  • Using Yarn
yarn add react-notificantion-toast
  • Using PNPM
pnpm install react-notificantion-toast

How to use in react.js

  • First import useNotificantion hook from react-notificantion-toast your npm library

  • Then initialize it and set a duration of this notificantion visibility for milliseconds, if you're not initialized it such as useNotificantionToast(50000), then it take it's default value which are 5000 like 5000ms or 5 seconds.

  • Or you can use a .env's local variable for initialized this notificantion toast duration's value.

  • When you call const [active, Toast] = useNotificantionToast() this function you got two returning variable which one notificantion toast activator function and other one is notificantion toast component which receive tow attributes of parameter type & text this two are takes definitely a string value.

  • The type is receive some specific type of string which are indicate this notificantion's type.

  • And the text receive an string which are the main message's text!

  • All the message types are available on that present version are ----

["success", "danger", "warning", "primary", "download", "normal", "info", "dark"]
VITE_NOTIFICANTION_TOAST_DURATION = 5000 # 5s
import useNotificantionToast from 'react-notificantion-toast';
export default function App() {
  const [active, Toast] = useNotificantionToast();

  return (
    <div>
      <div>
        <button
          onClick={function () {
            active((prevState) => !prevState);
          }}
          className="click"
        >
          click
        </button>
      </div>
      <div>
        <Toast
          type="success"
          text="Hi! I am from notificantion toast"
        />
      </div>
    </div>
  );
}

Pleasure:

  • I hope you are enjoy to use this library.
  • Please give an github star, If it's really helpful for you!
  • Support me on SYED AMIR ALI
  • Thanks in advance & stay safe and keep safe.
  • NPM