1.1.1 • Published 6 years ago

@sajankumarv88/react-notification v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

react-notification

React Notification component will be useful for anyone to notifiy some information on their react applications or website.

NPM JavaScript Style Guide

Install

npm install --save @sajankumarv88/react-notification

Usage

import React, { Component } from 'react'

import {NotificationStack, Notification} from '@sajankumarv88/react-notification'

class Example extends Component {
  constructor(props) {
    super(props);
    this.close = this.close.bind(this);
  }

  close() {
    console.log('notification closed');
  }

  render () {
    return (
      <div>
        <NotificationStack limit="5">
          <Notification key="1" text='Modern React component module'
          type="warning" onCloseHandler={this.close}
          />
          <Notification key="2" text='Modern React component module'
          type="info" onCloseHandler={this.close}
          />
          <Notification key="3" text='Modern React component module'
          type="danger" onCloseHandler={this.close}
          />
          <Notification key="4" text='Modern React component module'
          type="success" onCloseHandler={this.close}
          />
          <Notification key="5" text='Modern React component module'
          type="danger" onCloseHandler={this.close}
          />
          <Notification key="6" text='Modern React component module'
          type="success" onCloseHandler={this.close}
          />
        </NotificationStack>
      </div>
    )
  }
}

License

MIT © sajankumar