react-native-touchable-scale-reanimated-reanimated

1.0.1ย โ€ขย Publicย โ€ขย Published

Touchable Scale Reanimated

Hi ๐Ÿ‘‹

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

TouchableScale

Getting Started ย |ย  Properties ย |ย  Example ย 

๐Ÿš€ Getting Started

Prerequisites

Install

npm install react-native-touchable-scale-reanimated

๐Ÿ“ Properties

Touchable Scale Reanimated

Property Type Optional Default Description
style array or object Yes - Style definition of the component we want to render
children array or object No - Component
onPress func Yes - Function to be called when onPress event is handled
scaleValue number Yes 0.95 Set how much you want to scale the component
durationValue number Yes 150 Set the scale duration

Example

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

Package Sidebar

Install

npm i react-native-touchable-scale-reanimated-reanimated

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

11.1 kB

Total Files

5

Last publish

Collaborators

  • ialoig