/react-native-bouncy-touchable

A bouncing touchable animated view

Primary LanguageJavaScript

react-native-bouncy-touchable

package version package downloads standard-readme compliant package license make a pull request

A bouncing touchable animated view

Table of Contents

Install

This project uses node and npm.

$ npm install react-native-bouncy-touchable
$ # OR
$ yarn add react-native-bouncy-touchable

Usage

export default class Button extends Component {

    render () {
      return (
            <BouncyView 
                delay={60} // Animation delay in miliseconds
                scale={1.1} // Max scale of animation
                style={styles.button} 
                onPress={this.props.onPress}
            >
              <Text style={styles.buttonText}>
                {this.props.children}
              </Text>
            </BouncyView>
      )
    }
  }

Props

Property Type Description Default Value
onPress function Function called when user taps the view area noop
scale number Max scale of animation 1.1
delay float Animation delay in miliseconds 40
moveSlop number Slop area for press 15
style object Custom style for the component {}

Credits

Heavily based on react-native-bounceable

Contribute

  1. Fork it and create your feature branch: git checkout -b my-new-feature
  2. Commit your changes: git commit -am "Add some feature"
  3. Push to the branch: git push origin my-new-feature
  4. Submit a pull request

License

MIT