react-material-notification

Package for displaying material-style notifications in your react app, built with flux architecture.

Usage no npm install needed!

<script type="module">
  import reactMaterialNotification from 'https://cdn.skypack.dev/react-material-notification';
</script>

README

npm-material-notification

This is a package to show material-ui styled notification in your react project.

To use it:

  1. require the package
var N = require('react-material-notification');

  1. render it in your master component
...
render: function() {
    return <div>
                <N.Component />
            </div>
}
...
  1. 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