A react-native bouncing ball component for both iOS and Android.
npm install react-native-bouncing-ball 
react native component bouncing ball for both iOS and Android. There are two ways to generate balls, and .
Use the generate ball
Use the generate ball
npm i react-native-bouncing-ball --save
Use the generate ball
``javascript
import React, {PureComponent} from 'react';
import {StyleSheet, ImageBackground} from 'react-native';
import BouncingBalls from 'react-native-bouncing-ball'
export default class BouncingBallsComponent extends PureComponent {
render() {
return (
animationDuration={5000}
minSpeed={30}
maxSpeed={200}
minSize={40}
maxSize={100}
imageBall={require('./images/bouncing_ball.png')}
/>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
}
});
`
Use the generate ball
`javascript
import React, {PureComponent} from 'react';
import {StyleSheet, ImageBackground} from 'react-native';
import BouncingBalls from 'react-native-bouncing-ball'
export default class BouncingBallsComponent extends PureComponent {
render() {
return (
animationDuration={5000}
minSpeed={30}
maxSpeed={200}
minSize={40}
maxSize={100}
style={{
backgroundColor: '#CDFFCD'
}}
/>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
}
});
`
| Props | PropType | Default Value | Description |
| ----- | --------- | ------------| ------------- |
| amount | number | 1 | the number of balls |number
| animationDuration | | 5000 | Every section animation time |func
| animationType | | Easing.linear | Animation type |number
| minSpeed | | 30 | The slowest speed of the ball |number
| maxSpeed | | 200 | The fastest speed of the ball |number
| minSize | | 40 | The largest ball size |number
| maxSize | | 100 | The smallest ball size |object
| style | | null | The style of the ball |object
| imageBall | | null | Choose Image` generate ball|
MIT Licence