Giter VIP home page Giter VIP logo

avrcoelho / react-hook-notification Goto Github PK

View Code? Open in Web Editor NEW
25.0 2.0 0.0 1.66 MB

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

Home Page: https://www.npmjs.com/package/react-hook-notification

License: MIT License

JavaScript 2.09% TypeScript 97.91%
react notifications react-hooks hooks hook toast toast-notifications typescript javascript javascript-library

react-hook-notification's Introduction

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

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

LICENSE

License

Developed by: André Coelho

react-hook-notification's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.