https://github.com/cdvntr/react-native-confetti
Raining confetti made with react native animations
https://github.com/cdvntr/react-native-confetti
confetti react-native
Last synced: about 1 year ago
JSON representation
Raining confetti made with react native animations
- Host: GitHub
- URL: https://github.com/cdvntr/react-native-confetti
- Owner: cdvntr
- License: mit
- Created: 2016-07-29T13:49:40.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2021-08-17T17:29:21.000Z (almost 5 years ago)
- Last Synced: 2024-10-23T11:54:13.879Z (over 1 year ago)
- Topics: confetti, react-native
- Language: JavaScript
- Homepage:
- Size: 2.19 MB
- Stars: 221
- Watchers: 5
- Forks: 55
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-confetti
Raining confetti made with react native animations
## Installation
```sh
npm i -S react-native-confetti
```
## Usage
```javascript
import React, {Component} from 'react';
import {
AppRegistry,
StyleSheet,
View
} from 'react-native';
import Confetti from 'react-native-confetti';
class RNConfetti extends Component {
componentDidMount() {
if(this._confettiView) {
this._confettiView.startConfetti();
}
}
render() {
return
this._confettiView = node}/>
}
}
const styles = StyleSheet.create({
container: {
flex: 1
}
});
```
## Props
Property | Type | Default | Description
--- | --- | --- | ---
`confettiCount` | `Number` | 100 | Number of confetti
`timeout` | `Number` | 30 (ms) | Timeout between confetti
`untilStopped` | `Boolean` | false | Render confetti continuously until `stopConfetti()` is called. This ignores `confettiCount`.
`duration` | `Number` | 6000 (ms) | Duration until a conffetti reaches the bottom
`colors` | `Array` | ["rgb(242.2, 102, 68.8)","rgb(255, 198.9, 91.8)","rgb(122.4, 198.9, 163.2)","rgb(76.5, 193.8, 216.7)","rgb(147.9, 99.4, 140.2)"] | Array of color strings to choose from for the confetti
`size` | `Number` | 1 | Multiplier for size of confetti (width and heigh)
`bsize` | `Number` | 1 | Multiplier for radius of confetti (border radius)