amaryllis-notifications
React notification system with redux
Installation
npm install --save amaryllis-notifications
Dependecies
In order to use the redux actions, this package assumes that you have react-redux and redux-thunk installed and configured.
Documentation
0. Include css file in your app
Either by copying the css to your html or requiring it directly from node_modules using SASS or other preprocessor
using sass:
;
1. Add Notifications Reducer to redux
;;;; const rootReducer = ; const store = ; ;
2. Add Notifications Component to your react application
Preferabble high in the DOM tree
; ReactDOM;
3. Use it in your app
const mapActionsToProps = notify: NotificationsActionsnotify Component { const ...props = thisprops; props; } { return <div></div>; } Page = Page
4. Options
Options:
-
timeout: The message will be dissmissed by default after 3 seconds, if you want it to be static until clicked, use 0, or set other timeout in ms
-
type: The type of the message, available types are:
- AMARYLLIS_TYPES.INFO
- AMARYLLIS_TYPES.WARNING
- AMARYLLIS_TYPES.SUCCESS
- AMARYLLIS_TYPES.ERROR
- AMARYLLIS_TYPES.HAPPY
all other type willbe considered custom and look for customization, either by providing a css class or by addidng style object
-
icon:
Animations: Message Types: Customization:
changing the default options
License
MIT