0.1.2 • Published 3 years ago

react-material-notify v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-material-notify

This package can help you to create and display notifications in your React application

The package is tiny, less than 3 KB!

It's in active development stage now. 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

FieldTypeDescriptionDefault value
id?number or stringID of the notificationDate.now()
messagestringText of the notification
levelNotificationLevelTypeLevel (color) of the notification
duration?number or 'forever'Time of the notification showing (in ms). Use 'forever' or value <=0 for unlimited showing5000
type NotificationLevelType = 'info' | 'success' | 'warning' | 'error';

Demo

CodeSandbox

Do you have a bug report or improvement idea?

Please, open the issue! :)