You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-hook-notification

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hook-notification

Add notifications in your React app. Types: success, error, warning, info or default

3.0.9
Source
npmnpm
Version published
Maintainers
1
Created
Source

React Hook Notification

Add notifications in your React app. Types: success, error, warning, info or default

Demo

Storybook demo

https://reverent-lalande-5e2160.netlify.app

Install

npm install react-hook-notification

or

yarn add react-hook-notification

Usage

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>
  );
}

Props

PropertyTypeRequiredDefaultDescription
textstringyesNotification text
titlestringnoNotification title
positiontop-right | top-center | top-left | bottom-right | bottom-center | bottom-leftnotop-rightNotification position
themecolored | light | darknocoloredNotification theme
transitionbounce | flip | fade | slide | zoomnobounceNotification transition
delaynumberno5000Notification delay in milliseconds
showProgressBarbooleannotrueNotification shows or hides progress bar
showButtonClosebooleannotrueNotification show or hide close button
closeOnClickbooleannotrueNotification closes on click
showIconbooleannotrueNotification show or hide icon
autoClosebooleannotrueAutomatic closing of the notification after the delay ends
pauseOnHoverbooleannotrueAuto close pause on hover
draggablebooleannotrueEnable or disable drag

LICENSE

License

Developed by: André Coelho

Keywords

react

FAQs

Package last updated on 24 Apr 2022

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