React Notification UI Component
npm install
npm start
http://localhost:8000/examples/
online example: http://react-component.github.io/notification/examples/
var Notification = require('rc-notification');
Notification.newInstance({}, notification => {
notification.notice({
content: 'content'
});
});
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 |
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. |
maxCount | number | max notices show, drop first notice if exceed limit | |
closeIcon | ReactNode | specific the close icon. |
remove single notice with specified key
destroy current notification
npm test
npm run chrome-test
npm run coverage
open coverage/ dir
rc-notification is released under the MIT license.