You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
![]() |
5 years ago | |
---|---|---|
.. | ||
assets | 5 years ago | |
dist | 5 years ago | |
es | 5 years ago | |
lib | 5 years ago | |
node_modules | 5 years ago | |
HISTORY.md | 5 years ago | |
LICENSE.md | 5 years ago | |
README.md | 5 years ago | |
package.json | 5 years ago |
README.md
rmc-notification
React Notification UI Component
Development
npm install
npm start
Example
http://localhost:8000/examples/
online example: http://react-component.github.io/m-notification/examples/
Feature
- support ie8,ie8+,chrome,firefox,safari
install
Usage
var Notification = require('rmc-notification');
Notification.newInstance({}, notification => {
notification.notice({
content: 'content'
});
});
API
Notification.newInstance(props, (notification) => void) => void
props details:
name | type | default | description |
---|---|---|---|
prefixCls | String | prefix class name for notification container | |
style | Object | {'top': 65, left: '50%'} | additional style for notification container. |
getContainer | getContainer(): HTMLElement | function returning html node which will act as notification container |
notification.notice(props)
props details:
name | type | default | description |
---|---|---|---|
content | React.Element | content of notice | |
key | String | id of this notice | |
closable | Boolean | whether show close button | |
onClose | Function | called when notice close | |
duration | number | 1.5 | after duration of time, this notice will disappear.(seconds) |
style | Object | { right: '50%' } | additional style for single notice node. |
notification.removeNotice(key:string)
remove single notice with specified key
notification.destroy()
destroy current notification
Test Case
npm test
npm run chrome-test
Coverage
npm run coverage
open coverage/ dir
License
rmc-notification is released under the MIT license.