0.0.4 • Published 4 years ago

react-native-touch-ripple v0.0.4

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

react-native-touch-ripple

platforms npm travis

Demo

Features

  • Easy to use
  • Configurable
  • Consistent look and feel on iOS and Android
  • Can be used as drop-in replacement for TouchableWithoutFeedback
  • Pure javascript implementation
  • RTL Support

Installation

npm install --save react-native-touch-ripple

or

yarn add react-native-touch-ripple

Usage

import React, { Component } from 'react';
import { Text } from 'react-native';
import TouchRipple  from 'react-native-touch-ripple'

class Example extends Component {
  render() {
    return (
      <TouchRipple>
        <Text>Press Here</Text>
      </TouchRipple>
    );
  }
}

Properties

namedescriptiontypedefault
rippleColorRipple colorStringrgb(0, 0, 0)
rippleOpacityRipple opacityNumber0.3
rippleDurationRipple duration in msNumber400
rippleSizeRipple size restrictionNumber0
rippleContainerBorderRadiusRipple container border radiusNumber0
rippleCenteredRipple always starts from centerBooleanfalse
rippleSequentialRipple should start in sequenceBooleanfalse
rippleFadesRipple fades outBooleantrue
disabledRipple should ignore touchesBooleanfalse
onPressInTouch moved in or started callbackFunction-
onPressOutTouch moved out or terminated callbackFunction-
onPressTouch up inside bounds callbackFunction-
onLongPressTouch delayed after onPressIn callbackFunction-
onRippleAnimationAnimation start callbackFunction-

Other TouchableWithoutFeedback properties will also work