rc-notification
notification ui component for react
Last updated 10 years ago by yiminghe .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install rc-notification 
SYNC missed versions from official npm registry.

rc-notification

React Notification UI Component

NPM version dumi build status Test coverage npm download bundle size

Install

rc-notification

Usage

import Notification from 'rc-notification';

Notification.newInstance({}, notification => {
  notification.notice({
    content: 'content'
  });
});

Compatibility

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Electron
Electron
IE11, Edge last 2 versions last 2 versions last 2 versions last 2 versions

Example

http://localhost:8001

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.

Current Tags

  • 5.6.2                                ...           latest (3 months ago)

76 Versions

  • 5.6.2                                ...           3 months ago
  • 5.6.1                                ...           3 months ago
  • 5.6.0                                ...           7 months ago
  • 5.5.0                                ...           7 months ago
  • 5.4.0                                ...           10 months ago
  • 5.3.0                                ...           a year ago
  • 5.2.0                                ...           a year ago
  • 5.2.0-4                                ...           a year ago
  • 5.2.0-3                                ...           a year ago
  • 5.2.0-2                                ...           a year ago
  • 5.2.0-1                                ...           a year ago
  • 5.2.0-0                                ...           a year ago
  • 5.1.1                                ...           a year ago
  • 5.1.0                                ...           a year ago
  • 5.1.0-1                                ...           a year ago
  • 5.0.5                                ...           a year ago
  • 5.0.4                                ...           2 years ago
  • 5.0.3                                ...           2 years ago
  • 5.0.2                                ...           2 years ago
  • 5.0.1                                ...           2 years ago
  • 5.0.0                                ...           2 years ago
  • 4.6.1                                ...           2 years ago
  • 5.0.0-alpha.9                                ...           3 years ago
  • 5.0.0-alpha.8                                ...           3 years ago
  • 5.0.0-alpha.7                                ...           3 years ago
  • 5.0.0-alpha.6                                ...           3 years ago
  • 5.0.0-alpha.5                                ...           3 years ago
  • 5.0.0-alpha.4                                ...           3 years ago
  • 5.0.0-alpha.3                                ...           3 years ago
  • 5.0.0-alpha.2                                ...           3 years ago
  • 5.0.0-alpha.1                                ...           3 years ago
  • 5.0.0-alpha.0                                ...           3 years ago
  • 4.6.0                                ...           3 years ago
  • 4.5.7                                ...           4 years ago
  • 4.5.6                                ...           4 years ago
  • 4.5.5                                ...           4 years ago
  • 4.5.4                                ...           4 years ago
  • 4.5.3                                ...           4 years ago
  • 4.5.2                                ...           4 years ago
  • 4.5.1                                ...           4 years ago
  • 4.5.0                                ...           4 years ago
  • 4.4.0                                ...           5 years ago
  • 4.3.2                                ...           5 years ago
  • 4.3.0                                ...           5 years ago
  • 4.0.0                                ...           5 years ago
  • 4.0.0-rc.1                                ...           5 years ago
  • 4.0.0-rc.0                                ...           5 years ago
  • 3.3.1                                ...           6 years ago
  • 3.3.0                                ...           6 years ago
  • 3.2.0                                ...           6 years ago
  • 3.1.1                                ...           7 years ago
  • 3.1.0                                ...           7 years ago
  • 3.0.1                                ...           7 years ago
  • 3.0.0                                ...           7 years ago
  • 2.0.6                                ...           7 years ago
  • 2.0.5                                ...           7 years ago
  • 2.0.4                                ...           7 years ago
  • 2.0.3                                ...           7 years ago
  • 2.0.2                                ...           7 years ago
  • 2.0.1                                ...           7 years ago
  • 2.0.0                                ...           8 years ago
  • 1.4.3                                ...           8 years ago
  • 1.4.2                                ...           8 years ago
  • 1.4.1                                ...           8 years ago
  • 1.4.0                                ...           8 years ago
  • 1.3.6                                ...           8 years ago
  • 1.3.5                                ...           8 years ago
  • 1.3.4                                ...           9 years ago
  • 1.3.3                                ...           9 years ago
  • 1.3.2                                ...           9 years ago
  • 1.3.1                                ...           9 years ago
  • 1.3.0                                ...           9 years ago
  • 1.2.0                                ...           9 years ago
  • 1.1.0                                ...           9 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 5
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (5)
Dependents (3)

© 2010 - cnpmjs.org x YWFE | Home | YWFE