1.0.2 • Published 2 years ago

rjsnotify v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

rjsnotify 🎉

A simple react notification component. ✨

Install

$ npm install rjsnotify

Usage

import Notification, { notify } from 'rjsnotify';

const App = () => {
	const showNotification = () => {
		notify({ message: 'Hello world', placement: 'TOP_RIGHT', type: 'info' });
	};

	return (
		<div>
			<Notification />
			<button onClick={showNotification}>notiy</button>
		</div>
	);
};

API

notify props

NameTypeDefaultRequired
messagestringtrue
placementsstring"TOP_LEFT"false
durationnumber1500false
typestringfalse

placements

  • TOP_LEFT
  • TOP_RIGHT
  • BOTTOM_LEFT
  • BOTTOM_RIGHT

types

  • danger
  • success
  • info
  • warning

Pending features 🚧

  • CSS transitions
  • Rendering custom elements
  • Pause on hover

Contribute 🧑‍💻

Clone this repository make a pull request to develop branch

MIT ❤️