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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-noti

v1.0.0

Published

react-noti - Toast Notifications made easy

Readme


Build Status Code Coverage version downloads MIT License

Table of Contents

Demo

A demo is worth a thousand words

Installation

$ npm install react-noti styled-components@5
$ yarn add react-noti styled-components@5

Usage

import React from 'react'
// POSITION is a helper variable that provides available position values to avoid typos
import { ReactNoti, notify, POSITION } from 'react-noti'

function App() {
  const handleSuccessClick = () => {
    notify.success('You can put almost anything here.')
  }
  const handleInfoClick = () => {
    notify.info('Info message', { title: 'Title here' })
  }
  const handleWarningClick = () => {
    notify.warning('Warning message', {
      title: 'Do not auto dismiss',
      autoDismiss: false,
    })
  }
  const handleErrorClick = () => {
    notify.error('Error message', {
      title: 'Close after 9000ms',
      timeOut: 9000,
    })
  }

  return (
    <div className="App">
      <ReactNoti position={POSITION.TOP_RIGHT} />

      <div>
        <button onClick={handleSuccessClick}>Success!</button>
        <button onClick={handleInfoClick}>Info!</button>
        <button onClick={handleWarningClick}>Warning!</button>
        <button onClick={handleErrorClick}>Error!</button>
      </div>
    </div>
  )
}

export default App

API

ReactNoti container

| Props | Type | Default | Required | Description | | ------------- | --------- | ----------- | -------- | ------------------------------------------------------------------------------------------------------------------- | | position | string | top-right | ✘ | Defines location of the ReactNoti component on the screen. Available options: top-right, top-left, top-center, bottom-right, bottom-left, bottom-center. | | autoDismiss | boolean | true | ✘ | Auto dismisses notification after the timeOut. Can be overridden individually. | | timeOut | number | 5000 | ✘ | The default time in ms for the all toast notifications in the container tray. Can be overridden individually. | | single | boolean | false | ✘ | Single notification mode. Show only the last notification. | | icons | boolean | true | ✘ | Show default toast notifications icons or not. | | pauseOnHover| boolean | true | ✘ | Pause auto-dismissing countdown on mouse hover. Can be overridden individually. | | showProgress| boolean | true | ✘ | Show countdown progress-bar on toast notifications. Can be overridden individually. | | className | string | undefined | ✘ | Adds a class to the ReactNoti container for custom styling. |

notify toast options

| Params | Type | Default | Required | Description | | ------------- | ----------------------| ----------- | -------- | --------------------------------------------------------------------------------- | | content | string | element | - | ✓ | A text string or a component containing the content of the Toast notification. | | options | object | {} | ✘ | Options are listed bellow. |

Optional notify methods parameters

| Options | Type | Default | Description | | ------------- | ----------| ----------- | ---------------------------------------------------------------------------------------------- | | title | string | undefined | Text string containing the title of the Toast notification. | | autoDismiss | boolean | true | Auto dismiss notification after the timeOut. Overrides global ReactNoti autoDismiss. | | timeOut | number | 5000 | Time in ms for individual Toast in the tray. Overrides global ReactNoti timeOut. | | pauseOnHover| boolean | true | Pause auto-dismissing countdown on mouse hover. Overrides global ReactNoti pauseOnHover. | | showProgress| boolean | false | Show countdown progress-bar on toast notifications. Overrides global ReactNoti showProgress. |

:warning:️ Toast options supersede ReactNoti container props :warning:

const Img = ({ src }) => <span><img width={48} src={src} /></span>
const options = {
  title: 'Toast title'
  autoDismiss: true,
  timeOut: 5000,
  pauseOnHover: true,
  showProgress: false
}

// Success.
notify.success('Hello')
// Info. Pass optional params that overwrites the default ones
notify.info('World', options)
// Warning. Passes React Component as a message content
notify.warning(<Img />)
// Error. Passes optional param that disables toast auto dismiss
notify.error('Oops!', { autoDismiss: false })

// Removes all toasts!
notify.closeAll()

License

MIT