Skip to content

A react component to show growl-like notifications using bootstrap alerts

License

Notifications You must be signed in to change notification settings

MolecularMatch/react-bs-notifier

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Bootstrap Notifier

A react component to show growl-like notifications using bootstrap alerts.

See a live example.

Install

npm install react-bs-notifier --save

Usage

var React = require("react");
var Notifier = require("react-bs-notifier");

var alerts = [{
	type: "info",
	message: "This is an information message."
}, {
	type: "warning",
	message: "This is a warning message!"
}, {
	type: "danger",
	headline: "Woah!",
	message: "This is a danger message!"
}, {
	type: "success",
	headline: "Good job!",
	message: "This is a success message!"
}];

React.render(<Notifier alerts={alerts} />, document.getElementById("myApp"));

Options

You can pass an onDismiss callback to the component to override what happens when an item is dismissed.

React.render(<Notifier alerts={alerts} onDismiss={myDismissFunc} />, document.getElementById("myApp"));

function myDismissFunc(item) {
	console.log(item);
}

Instead of dismissing the notification, the component will call the myDismissFunc. This is a useful way to call an action to integrate this component into a flux application.

About

A react component to show growl-like notifications using bootstrap alerts

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 81.9%
  • CSS 18.1%