2.0.1 • Published 3 years ago

kodobe-react-notifier v2.0.1

Weekly downloads
6
License
ISC
Repository
-
Last release
3 years ago

Kodobe React Notifier

This is a simple react notifier package

Install

npm install kodobe-react-notifier

or

yarn add kodobe-react-notifier

Setup

import Notifier from 'kodobe-react-notifier';

Usage

import Notifier from "kodobe-react-notifier";

function App() {
    return (
        <div>
            <h3>Here is how to use a notifier</h3>
             <br />
             <Button
                onClick={() =>
                Notifier.show({
                    heading: "Heading",
                    onCancel: () => null,
                    content: (
                    <div>
                        This is life <b>This is it</b>
                    </div>
                    ),
                })
                }
            >
                Show Notification
            </Button>
        </div>
    );
}

Options

  • content: Any thing
  • heading: Any thing
  • okText: (string)
  • cancelText: (string)
  • onOk: callback for when ok button is clicked (function)
  • onCancel: callback for when cancel button is clicked (function)