0.0.6 • Published 7 years ago

noty-noty v0.0.6

Weekly downloads
25
License
-
Repository
-
Last release
7 years ago

Noty, A customizable Javascript notification library

Noty is a small javascript notification library that doesn't depend on jQuery. It can easily be used in your client side applications regardless of the framework

Installation

Add the package npm package into your project directory like so:

$ yarn add noty-noty

Usage

Just use it by importing the library

import Noty from 'noty-noty';

const ExampleComponent = (props) => {

  const handleClick = () => {
    Noty({
      type: 'primary',
      message: 'Hi there, Welcome back to our app',
    });
  };

  return (
    <button onClick={handleClick}>Click me!</button>
  );
}

Options

Below shows a list of options you can pass to Noty

OptionDescriptionExample Values
typeSets the type of alert to show it. (default: primary)primary, success, info, danger
iconSets an icon for the alert. You can pass it any icon classes you have configured (default: "")fa fa-info-circle, glyphicon glyphicon-envelope
htmlOption to pass html content. When option is set, title and message options are not used (default: null)<h3>Example</h3>
titleSets a heading for the alert (default: "")-
messageSets a message body (default: "")-
closeBtnShows a close button that allows users to close alert (default: true)-
timerSet timer delay to show alert before disappearing (default: 500)-
onShowSet handler to run right before alert is shown-
onShownSet handler to run after alert is shown-
onHideSet handler function to run right before it is hidden-
onHiddenSet handler function to run after it is hidden-

TODO

  • option for page banner alert
  • option for panel level alert

Contributing

Feel free to create an issue or pull request if there's something you wish to be added to it

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago