🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@rc-component/notification

Package Overview
Dependencies
Maintainers
5
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rc-component/notification

notification ui component for react

latest
Source
npmnpm
Version
2.0.7
Version published
Weekly downloads
671K
11.48%
Maintainers
5
Weekly downloads
 
Created
Source

@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
Firefox
Firefox
last 2 versions
Chrome
Chrome
last 2 versions
Safari
Safari
last 2 versions
Electron
Electron
last 2 versions

Example

http://localhost:8001

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

API

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

props details:

nametypedefaultdescription
prefixClsStringprefix class name for notification container
styleObject{'top': 65, left: '50%'}additional style for notification container.
getContainergetContainer(): HTMLElementfunction returning html node which will act as notification container
maxCountnumbermax notices show, drop first notice if exceed limit

notification.notice(props)

props details:

nametypedefaultdescription
contentReact.Elementcontent of notice
keyStringid of this notice
closableBoolean | { closeIcon: ReactNode, onClose: VoidFunction }whether show close button
onCloseFunctioncalled when notice close
durationnumber | false4.5The delay for automatic closing in seconds. Set to 0 or false to not close automatically.
showProgressbooleanfalseshow with progress bar for auto-closing notification
pauseOnHoverbooleantruekeep the timer running or not on hover
styleObject { right: '50%' } additional style for single notice node.
closeIconReactNodespecific the close icon.
propsObjectAn 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-component/notification is released under the MIT license.

Keywords

react

FAQs

Package last updated on 15 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts