notify-library

0.1.17 • Public • Published

Notify-Library

Notify-Library allow you to add notification to your app with ease.

Installation

You can install this package by simply running npm install --save notify-library or yarn add notify-library.

Once this has finished, you can import the package. Below is an example:

 import Notify from "notify-library";

Usage

The Notify package allows you to fire different levels of notifications. At present you can fire: info, success error and warning. To do this you simply call the respective method. For example, to fire a success notification you would do the following:


<Notify notifyType="success" message="Successfully called notify library">

As you can see, the notifyType props as like success, info and so on is the type of the notification. The message props is the message of the notification. Default notifyType is success.

Configuration

There are a small number of options you can configure in this package. These are the positionValue and autoClose.

To set an position, you can simply pass the positionValue as props. Here is an example:


<Notify positionValue="topright" message="Successfully called notify library">

Position

By default, the position is set to "topright". However you can alter this to one of the following if you wish: "topleft", "bottomright", "bottomleft".

Delay

To set an delay time for notification, you can simply pass the autoClose as props. Here is an example:


 <Notify positionValue="topright" autoClose="2000" message="Successfully called notify library">

The delay value determines how long this notification appears on screen before it disappears. The default value is 3 seconds (3000ms). You can alter this to any number you wish.

Readme

Keywords

none

Package Sidebar

Install

npm i notify-library

Weekly Downloads

2

Version

0.1.17

License

none

Unpacked Size

14.7 kB

Total Files

12

Last publish

Collaborators

  • manojprabhakar