All Projects → hankzhuo → react-native-bouncing-ball

hankzhuo / react-native-bouncing-ball

Licence: MIT License
react native component bouncing ball for iOS and Android

Programming Languages

javascript
184084 projects - #8 most used programming language
objective c
16641 projects - #2 most used programming language
python
139335 projects - #7 most used programming language
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to react-native-bouncing-ball

react-native-carousel-component
React Native Carousel Component for IOS & Android
Stars: ✭ 61 (+69.44%)
Mutual labels:  react-native-component
react-native-bubble-tabbar
🧼 Bubble Tab Bar Component for React Native which supports React Navigation V5 and TypeScript
Stars: ✭ 43 (+19.44%)
Mutual labels:  react-native-component
react-native-android-bottom-navigation
Native UI Component of Android's BottomNavigation for react-native
Stars: ✭ 18 (-50%)
Mutual labels:  react-native-component
react-native-radio-buttons-group
Simple, best and easy to use radio buttons for react native apps.
Stars: ✭ 145 (+302.78%)
Mutual labels:  react-native-component
react-native-swipe-action-list
A list view that supports swipe actions for React Native (Android & iOS).
Stars: ✭ 18 (-50%)
Mutual labels:  react-native-component
iconic-input
Beautiful Input components for React Native... <IconicTextbox/> and much more!
Stars: ✭ 22 (-38.89%)
Mutual labels:  react-native-component
react-native-chat-ui
Actively maintained, community-driven chat UI implementation with an optional Firebase BaaS.
Stars: ✭ 168 (+366.67%)
Mutual labels:  react-native-component
react-native-responsive-image-view
React Native component for scaling an Image within the parent View
Stars: ✭ 152 (+322.22%)
Mutual labels:  react-native-component
react-native-masonry-brick-list
Staggered Or Masonary List View For React Native Written in pure js
Stars: ✭ 24 (-33.33%)
Mutual labels:  react-native-component
DeveloperFolio
A DevFolio/Developer Portfolio built using ReactJs and Animation libraries.
Stars: ✭ 51 (+41.67%)
Mutual labels:  react-animations
react-native-window-guard
SafeAreaView alternative for React Native which provides relevant window insets for both iOS and Android.
Stars: ✭ 30 (-16.67%)
Mutual labels:  react-native-component
react-native-card-list
A React Native component which displays a list of image cards that zoom to fullscreen
Stars: ✭ 19 (-47.22%)
Mutual labels:  react-native-component
react-native-user-inactivity
Simple component that alerts when the user is inactive (i.e. when the App surface hasn't been touched for X ms)
Stars: ✭ 148 (+311.11%)
Mutual labels:  react-native-component
react-native-uiw
A UI component library based on React Native (Android & iOS).
Stars: ✭ 28 (-22.22%)
Mutual labels:  react-native-component
react-native-boilerplate
React Native Boilerplate - React Native Starter Kits : react-navigation and its dependencies, redux, redux persist and redux thunk, redux toolkit, react native vector icons, react-native async storage
Stars: ✭ 68 (+88.89%)
Mutual labels:  react-native-component
react-native-ios-modal
A react-native component for displaying a modal on iOS by natively wrapping a react-native view inside a UIViewController and presenting it.
Stars: ✭ 94 (+161.11%)
Mutual labels:  react-native-component
react-native-touchable-safe
A single easy-to-use `<Touchable>` component, which harnesses the power of all React Native's `Touchable*` components.
Stars: ✭ 15 (-58.33%)
Mutual labels:  react-native-component
react-native-background-shapes
Beautiful backgrounds shapes to React Native based in flex (Android + IOS)
Stars: ✭ 65 (+80.56%)
Mutual labels:  react-native-component
react-native-category
react-native-category
Stars: ✭ 23 (-36.11%)
Mutual labels:  react-native-component
react-native-value-picker
Cross-Platform iOS(ish) style picker for react native.
Stars: ✭ 18 (-50%)
Mutual labels:  react-native-component

react-native-bouncing-ball

npm version

React Native component bouncing ball for both iOS and Android. There are two ways to generate balls, <Image/> and <View/>. The balls can always move randomly in the screen. When the component will Unmount, the animation will stop.

Demo

Use the <Image/> generate ball

ball_image

Use the <View/> generate ball

ball_view

Install

npm i react-native-bouncing-ball --save

Example

Use the <Image/> generate ball

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 (
      <ImageBackground style={styles.container} source={require('./images/background.jpg')}>
        <BouncingBalls
          amount={10}
          animationDuration={5000}
          minSpeed={30}
          maxSpeed={200}
          minSize={40}
          maxSize={100}
          imageBall={require('./images/bouncing_ball.png')}
         />
      </ImageBackground>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  }
});

Use the <View/> generate ball

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 (
      <ImageBackground style={styles.container} source={require('./images/background.jpg')}>
        <BouncingBalls
          amount={10}
          animationDuration={5000}
          minSpeed={30}
          maxSpeed={200}
          minSize={40}
          maxSize={100}
          style={{
            backgroundColor: '#CDFFCD'
          }}
         />
      </ImageBackground>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  }
});

Props

Props PropType Default Value Description
amount number 1 the number of balls
animationDuration number 5000 Every section animation time
animationType func Easing.linear Animation type
minSpeed number 30 The slowest speed of the ball
maxSpeed number 200 The fastest speed of the ball
minSize number 40 The largest ball size
maxSize number 100 The smallest ball size
style object null The style of the ball
imageBall object null Choose Image generate ball

LICENCE

MIT Licence

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].