New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-toast-notifier

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-toast-notifier

A simple and easy to use toast notification module for react.

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

react-toast-notifier CI status

A simple and easy to use toast notification module for react.

Installation

This is a React.js module available through the npm registry.
Installation is done using the npm install command:

$ npm install react-toast-notifier

Example & Usage (Success)

import React, { Fragment } from 'react';
import Notification, { notifier } from 'react-toast-notifier';

// for success message
const NotificationButton = () => {
  return (
    <Fragment>
      <Notification />
      <button onClick={() => {
        notifier({ type: "success", message: "Success message", autoDismissTimeout:5000 });
      }}>Toast</button>
    </Fragment>
  );
};

export default NotificationButton;

Example & Usage (Error)

import React, { Fragment } from 'react';
import Notification, { notifier } from 'react-toast-notifier';

// for error message
const NotificationButton = () => {
  return (
    <Fragment>
      <Notification />
      <button onClick={() => {
        notifier({ type: "error", message: "Error message", autoDismissTimeout:5000 });
      }}>Toast</button>
    </Fragment>
  );
};

export default NotificationButton;

Example & Usage (Warning)

import React, { Fragment } from 'react';
import Notification, { notifier } from 'react-toast-notifier';

// for warning message
const NotificationButton = () => {
  return (
    <Fragment>
      <Notification />
      <button onClick={() => {
        notifier({ type: "warning", message: "Warning message" });
      }}>Toast</button>
    </Fragment>
  );
};

export default NotificationButton;

Note

  • autoDismissTimeout default time is 4000
  • Available types : ["success", "warning", "error"]

Author

Rohan Shukla GitHub LinkedIn

License

© Licensed under the MIT License.

Keywords

react-toast-notifier

FAQs

Package last updated on 13 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts