react-native-elastic-swipe
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

react-native-elastic-swipe

MIT Licence PRs Welcome npm version

A simple react native swipe component with elastic effect.

npm install react-native-elastic-swipe

Props

interface Props {
  friction?: number
  criticalOffsetX?: number
  criticalOffsetY?: number
  swipeHorizontally?: boolean
  swipeVertically?: boolean
  onChangeReachStateOfHorizontal?(isReachedCriticalOffsetX: boolean): void
  onChangeReachStateOfVertical?(isReachedCriticalOffsetY: boolean): void
  onSwipeMove?(e: GestureResponderEvent, gestureState: PanResponderGestureState): void
  onSwipeEnd?(e: GestureResponderEvent, gestureState: PanResponderGestureState): void
  shouldSetPanResponder?(e: GestureResponderEvent, gestureState: PanResponderGestureState): boolean
}

Example

import Swipe from "react-native-elastic-swipe";
  
  ...
  render() {
    return (
      <Swipe
        friction={5}
        swipeHorizontally
        criticalOffsetX={21}
        onSwipeMove={this.onSwipeMove}
        onSwipeEnd={this.onSwipeEnd}
        onChangeReachStateOfHorizontal={this.onChangeReachStateOfHorizontal}
      >
        <View />    
      </Swipe>
    );
  }
  ...

Demo

Package Sidebar

Install

npm i react-native-elastic-swipe

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

12.6 kB

Total Files

5

Last publish

Collaborators

  • runjuu