react-native-elastic-swipe
v1.0.0
Published
A simple react native swipe component with elastic effect.
Downloads
16
Maintainers
Readme
react-native-elastic-swipe
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>
);
}
...