1.0.2 • Published 7 months ago

@rc-component/notification v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@rc-component/notification

React Notification UI Component

NPM version dumi build status Test coverage npm download bundle size

Install

@rc-component/notification

Usage

import Notification from '@rc-component/notification';

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

Compatibility

BrowserSupported Version
FirefoxFirefoxlast 2 versions
ChromeChromelast 2 versions
SafariSafarilast 2 versions
ElectronElectronlast 2 versions

Example

http://localhost:8001

online example: https://notification-react-component.vercel.app

API

Notification.newInstance(props, (notification) => void) => void

props details:

notification.notice(props)

props details:

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-component/notification is released under the MIT license.