
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
@rc-component/notification
Advanced tools
React Notification UI Component
import Notification from '@rc-component/notification';
Notification.newInstance({}, (notification) => {
notification.notice({
content: 'content',
});
});
| Browser | Supported Version |
|---|---|
![]() Firefox | last 2 versions |
![]() Chrome | last 2 versions |
![]() Safari | last 2 versions |
![]() Electron | last 2 versions |
online example: https://notification-react-component.vercel.app
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 |
props details:
| name | type | default | description |
|---|---|---|---|
| content | React.Element | content of notice | |
| key | String | id of this notice | |
| closable | Boolean | { closeIcon: ReactNode, onClose: VoidFunction } | whether show close button | |
| onClose | Function | called when notice close | |
| duration | number | false | 4.5 | The delay for automatic closing in seconds. Set to 0 or false to not close automatically. |
| 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. |
remove single notice with specified key
destroy current notification
npm test
npm run chrome-test
npm run coverage
open coverage/ dir
@rc-component/notification is released under the MIT license.
FAQs
notification ui component for react
The npm package @rc-component/notification receives a total of 548,020 weekly downloads. As such, @rc-component/notification popularity was classified as popular.
We found that @rc-component/notification demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

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.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.