Giter VIP home page Giter VIP logo

react-use-firework's Introduction

react-use-firework ๐ŸŽ†

npm version npm version

  • A simple react hook to create click-firework animation ๐ŸŽ†

Demo ๐Ÿชž

Edit react-use-ripple demo

Install ๐Ÿ“ฆ

yarn add react-use-firework

Usage ๐Ÿ“‹

import React, { useRef } from "react";

import useFireWork from "react-use-firework";

export component = ()=> {
  const ref = useRef(null);
  useFireWork(ref);

  return (
    <div
     ref={ref}
     style={{ width: "100%", height: "600px", background: "#000" }}
    />
  );
}

API

the usage demo above is the basic usage with default setting of useFirewrok, you can use it with some options like useFirework(ref,{ count: 10, ...otherOptions }) as well and the supporting options arguments are like the table below

name type default description
count number 30 The number of the firework dot
duration number 1500 the millisecond of the duration of firework
size number 6 the size of each firework dot
range number 200 the spread range radius of the firework
colors Array ["#f59342", '#f5e942', '#f54242'] the color of the firework
randomColor boolean false whether to apply random color into the firework

react-use-firework's People

Contributors

dependabot[bot] avatar uyarn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

react-use-firework's Issues

Invalid tag name for react dependency

While installing this library, I'm getting the following error:

npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name ">=^16.9.0": Tags may not have any characters that encodeURIComponent encodes.

I believe this is due to the react peer dependency.

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.