Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
react-hook-notification
Advanced tools
Add notifications in your React app. Types: success, error, warning, info or default
Add notifications in your React app. Types: success, error, warning, info or default
https://reverent-lalande-5e2160.netlify.app
npm install react-hook-notification
or
yarn add react-hook-notification
import React from 'react';
import { useNotification } from 'react-hook-notification';
export default function Component() {
const notification = useNotification();
return (
<button
type="button"
onClick={() =>
notification.success({
text: 'Notification test',
})
}
>
Dispatch
</button>
);
}
Property | Type | Required | Default | Description |
---|---|---|---|---|
text | string | yes | Notification text | |
title | string | no | Notification title | |
position | top-right | top-center | top-left | bottom-right | bottom-center | bottom-left | no | top-right | Notification position |
theme | colored | light | dark | no | colored | Notification theme |
transition | bounce | flip | fade | slide | zoom | no | bounce | Notification transition |
delay | number | no | 5000 | Notification delay in milliseconds |
showProgressBar | boolean | no | true | Show or hide progress bar |
showButtonClose | boolean | no | true | Show or hide close button |
closeOnClick | boolean | no | true | Close on click |
showIcon | boolean | no | true | Show or hide icon |
autoClose | boolean | no | true | Close notification after delay ends |
pauseOnHover | boolean | no | true | Auto close pause on hover |
draggable | boolean | no | true | Enable or disable drag |
titleMaxLines | number | no | 1 | Maximum number of lines for title |
textMaxLines | number | no | 2 | Maximum number of lines for text |
Developed by: André Coelho
FAQs
Add notifications in your React app. Types: success, error, warning, info or default
We found that react-hook-notification demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.