@bast1oncz/notifications

Notifications for react app

Usage no npm install needed!

<script type="module">
  import bast1onczNotifications from 'https://cdn.skypack.dev/@bast1oncz/notifications';
</script>

README

@BastSys/Notifications

Installation

Requirements

This package uses @material-ui as a peer dependency.

npm i @bast1oncz/notifications @material-ui/core @material-ui/icons -S

Usage

1. Render <NotificationProvider /> anywhere in your react tree.

    import {NotificationProvider} from '@bast1oncz/notifications/dist'

    <NotificationProvider>
        <App />
    </NotificationProvider>

2. Import a show message function and use them wherever in your application.

Note: To use any of these functions, the <NotificationProvider /> must be already rendered!

import {
    showSuccess,
    showError,
    showWarning,
    showInfo
} from '@bast1oncz/notifications/dist'

...
showSuccess('Hello world!')
...