react-native-confetti
Confetti
Installation
npm install react-native-confetti
Usage
Example
import Confetti from "react-native-confetti";
// ...
<Confetti animating={true} />
Props
style
Used to style and layout the Confetti
. See StyleSheet.js
and ViewStylePropTypes.js
for more info.
Type | Required |
---|---|
View.style | No |
colors
Colors to use for confetti
Type | Required |
---|---|
array | Yes |
animating
Bool to start/stop confetti animation. Defaults to false
.
Type | Required |
---|---|
bool | No |
duration
Confetti animation duration in milliseconds. Defaults to undefined
which means infinite duration.
Type | Required |
---|---|
number | No |
particlesPerSecond
Number of confetti particles to emit per second. Defaults to 64
.
Type | Required |
---|---|
number | No |
particles
Confetti particles to emit.
Note: Images doesn't appear in Android debug build
Type | Required |
---|---|
array | Yes |
particleLifeSpan
Life time of each particle in milliseconds
Type | Required |
---|---|
number | No |
TODO
- Modify speed prop on Android and add velocity on iOS
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT