1.0.1 • Published 2 years ago

react-native-touchable-scale-reanimated-reanimated v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Touchable Scale Reanimated

Hi 👋

Touchable Scale Reanimated is a simple React Native component animated with Reanimated 2 that scale when a gesture is handled

Prerequisites

Install

npm install react-native-touchable-scale-reanimated

Touchable Scale Reanimated

PropertyTypeOptionalDefaultDescription
stylearray or objectYes-Style definition of the component we want to render
childrenarray or objectNo-Component
onPressfuncYes-Function to be called when onPress event is handled
scaleValuenumberYes0.95Set how much you want to scale the component
durationValuenumberYes150Set the scale duration

You can find an example under the folder /example/button-scale/.

Run installation from here

npm install react-native-touchable-scale-reanimated

Run app with the following command package version

npm start

Here you can find a defined component (ie. Button ), wrapped with the Touchable Scale component:

import React from 'react'
import TouchableScale from "../TouchableScale"

function Button ({ title, type, size, border, onPress }) {

  return (
    <TouchableScale 
      onPress={onPress} 
      style={[ button.button, button[type], button[size], border ? button.border : null ]]}>
      <Text style={[ text.button, text[type]]}>
        {title}
      </Text>
    </TouchableScale>
  )
}

export default Button

made with 💪 by ialoig