Skip to content

bsiddiqui/react-native-gesture-view

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GestureView

Detects swipes in any <View> element including the swipe direction.

Usage

You should use GestureView as a normal <View> element:

render () {
  return (
    <GestureView onSwipeUp={this.onSwipeUp}>
      <Text>Swipe up for awesomeness</Text>
    </GestureView>
  )
}

Props

  • onSwipeUp an optional function that's triggered when the view detects a swipe to the up direction
  • onSwipeDown an optional function that's triggered when the view detects a swipe to the down direction
  • onSwipeLeft an optional function that's triggered when the view detects a swipe to the left direction
  • onSwipeRight an optional function that's triggered when the view detects a swipe to the right direction
  • onUnhandleSwipe an optional function that's triggered when the swipe was inside the threshold
  • swipeThreshold the amount of pixels that the swipe needs to have before being interpreted as a swipe. Defaults to 120
  • quadrantThreshold an angle that's computed into each quadrant, use it to make wider/narrowed quadrants. Defaults to 30

About

Swipe detection for React Native

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •