0.1.1 • Published 2 years ago
@1ohooks/use-swipe v0.1.1
onSwipeLeft(function): A callback function to be executed when a swipe left gesture is detected.onSwipeRight(function): A callback function to be executed when a swipe right gesture is detected.onSwipeUp(function): A callback function to be executed when a swipe up gesture is detected.onSwipeDown(function): A callback function to be executed when a swipe down gesture is detected.threshold(number): The minimum swipe distance required to trigger a swipe action (default is 50 pixels).maxDuration(number): The maximum duration (in milliseconds) for a swipe gesture to be recognized (default is 500 milliseconds).preventDefault(boolean): Whether to prevent the default behavior of touch events (default is false).
Here's an example of how to use useSwipe in your component: