README
npm-material-notification
This is a package to show material-ui styled notification in your react project.
To use it:
- require the package
var N = require('react-material-notification');
- render it in your master component
...
render: function() {
return <div>
<N.Component />
</div>
}
...
- wherever you want to add a notification, that should be displayed, call the function N.Add() and pass in the string or an array of strings that you want to display.
...
N.Add(['This is one notifications', 'This is another one']);
or
N.Add("I am a notification");
You can now also set the time after which the notifications will automatically dismissed by passing a property to the master component like so. Time is in ms by the way.
render: function() {
return <div>
<N.Component dismissAfter={12000} />
</div>
}
and that's about it :) Every notification will have a dismiss button that will hide it. Enjoy