Skip to content

nikitaodnorob/react-material-notify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-material-notify

NPM v0.1.2 MIT license Types 172 bytes after minimized 171 bytes after minimized and GZIP

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

How to install?

npm i react-material-notify --save

or

yarn add react-material-notify

How to use?

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 signature

createNotification(notification: NotificationType)

NotificationType fields

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';

Demo

CodeSandbox

Do you have a bug report or improvement idea?

Please, open the issue! :)