daniel-lundin / react-dom-confetti

Trigger confetti explosions on state transitions
623 stars 30 forks source link

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 component will trigger a confetti explosion 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 focuses on the latter.

Props

active

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

config

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

License MIT, copyright Daniel Lundin 2017