1.0.1 • Published 11 months ago

fri9g-notification-react v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

fri9g-notification-react

react version of fri9g-notification

NPM JavaScript Style Guide

Install

npm install --save fri9g-notification-react

Usage

import React, { Component } from 'react'

import { Fri9gNotifier,fri9g_notify } from 'fri9g-notification-react'
import 'fri9g-notification-react/dist/index.css'

const Example = (props) => {

  const triggerNotification = () => {
    let n = Math.ceil(Math.random()*3)
    switch(n) {
      case 1 : fri9g_notify.success("test"); break
      case 2 : fri9g_notify.error("test"); break
      case 3 : fri9g_notify.warning("test"); break
    }
  }

  return <>
    <button className='trigger' onClick={triggerNotification}>Trigger notification</button>
    <Fri9gNotifier position={fri9g_notify.POSITION.BOTTOM_LEFT} />
  </>
}

License

MIT © Fri9g