rc-notification

esm Styles
notification ui component for react
Keywords
reactreact-componentreact-notificationnotification
INSTALL
Type:
Version:
- Static
- Latest Patch
- Latest Minor
- Latest Major
- 5.6.4
- 5.6.3
- 5.6.2
- 5.6.1
- 5.6.0
- 5.5.0
- 5.4.0
- 5.3.0
- 5.2.0
- 5.1.1
- 5.1.0
- 5.0.5
- 5.0.4
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- 4.6.1
- 4.6.0
- 4.5.7
- 4.5.6
- 4.5.5
- 4.5.4
- 4.5.3
- 4.5.2
- 4.5.1
- 4.5.0
- 4.4.0
- 4.3.2
- 4.3.0
- 4.0.0
- 3.3.1
- 3.3.0
- 3.2.0
- 3.1.1
- 3.1.0
- 3.0.1
- 3.0.0
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.1
- 1.0.0
- 5.2.0-4
- 5.2.0-3
- 5.2.0-2
- 5.2.0-1
- 5.2.0-0
- 5.1.0-1
- 5.0.0-alpha.9
- 5.0.0-alpha.8
- 5.0.0-alpha.7
- 5.0.0-alpha.6
- 5.0.0-alpha.5
- 5.0.0-alpha.4
- 5.0.0-alpha.3
- 5.0.0-alpha.2
- 5.0.0-alpha.1
- 5.0.0-alpha.0
- 4.0.0-rc.1
- 4.0.0-rc.0
rc-notification
React Notification UI Component
Install
Usage
import Notification from 'rc-notification';
Notification.newInstance({}, notification => {
notification.notice({
content: 'content'
});
});
Compatibility
![]() IE / Edge |
![]() Firefox |
![]() Chrome |
![]() Safari |
![]() Electron |
---|---|---|---|---|
IE11, Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
Example
online example: https://notification-react-component.vercel.app
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 | |
maxCount | number | max notices show, drop first notice if exceed limit |
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) |
showProgress | boolean | false | show with progress bar for auto-closing notification |
pauseOnHover | boolean | true | keep the timer running or not on hover |
style | Object | { right: '50%' } | additional style for single notice node. |
closeIcon | ReactNode | specific the close icon. | |
props | Object | An object that can contain data-* , aria-* , or role props, to be put on the notification div . This currently only allows data-testid instead of data-* in TypeScript. See https://github.com/microsoft/TypeScript/issues/28960. |
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
rc-notification is released under the MIT license.