1.1.0 • Published 5 years ago

native-touchable v1.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

Native Touchable for React Native

implements a look and feel for Touchables in React Native. It display material design ripples on Android, and Opacity effect on iOS.

this Touchable isn't native, it's a fork of react-native-material-ripple by @n4kz

install

npm i -s native-touchable

implementation

import Touchable from 'native-touchable'

render () {
  return (
    <View>
      
      <Touchable onPress={ ... }>
        <Text>Do something!</Text>
      </Touchable>
      
    </View>
  )
}

props

This component inherits from TouchableOpacity and can use all his props (onPress, onPressIn, activeOpacity, etc.), btw can use all props from @n4kz/react-native-material-ripple too. But I decide to rename some props just for confortability.

proptypedefaultdescription
wavesbooleantrue in Android, false in iOSforce ripple render on iOS
sizenumber0 (means auto size)wave size, when it's 0 size is calc in auto
hintstring#000wave color
alphanumber0.3wave opacity
radiusnumbercalc from styles borderRadius property or 0border radius from wave overflow container
centeredbooleanfalseripple always starts from center
durationnumber600ripple duration in ms