This package can help you to create and display notifications in your React application
The package is tiny, the own bundle size is 172 bytes!
It isn't in active development stage now. Development restarting is planned. Current plans can be found in Issues
npm i react-material-notify --save
or
yarn add react-material-notify
Firstly, you have to pass the top component (e.g. App
) to NotificationContainer
(a hook option will be added in next versions)
And you need to call createNotification
to show new notification
createNotification(notification: NotificationType)
Field | Type | Description | Default value |
---|---|---|---|
id? |
number or string |
ID of the notification | Date.now() |
message |
string |
Text of the notification | |
level |
NotificationLevelType |
Level (color) of the notification | |
duration? |
number or 'forever' |
Time of the notification showing (in ms). Use 'forever' or value <=0 for unlimited showing |
5000 |
type NotificationLevelType = 'info' | 'success' | 'warning' | 'error';
Please, open the issue! :)