Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-dom-confetti

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dom-confetti

react component for dom-confetti

  • 0.0.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
51K
decreased by-27.93%
Maintainers
1
Weekly downloads
 
Created
Source

react-dom-confetti

npm version

Trigger confetti explosions on state transitions:

import Confetti from 'react-dom-confetti';

// in render
<Confetti active={ this.props.completed } />

This will trigger a confetti explision every time the prop active goes from a falsy to truthy value.

Demo

https://daniel-lundin.github.io/react-dom-confetti/

Why?

Slow operations annoy users and stakeholders. We have two options, either optimize slow operations or make it worth the wait. This library focus on the latter.

Props

active

Required. Triggers an explosion when transitions from falsy to truthy.

config

Optional. Configuration object to control the characteristics of the confetti:

  • angle - direction of the explosion in degrees, defaults to 90.
  • spread - spread of the explosion in degrees, deafults to 45.
  • startVelocity - Initial velocity of the particles, defaults to 45.
  • elementCount - Number of particle elements, default to 50.
  • decay - Decrease in velocity per frame, defaults to 0.9

License MIT, copyright Daniel Lundin 2017

Keywords

FAQs

Package last updated on 06 Jul 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc