Skip to content
Function

useSwipe

Detect swipe direction and distance on touch devices.

See useSwipe with a live demo

@danixsoft/hooks


useSwipe(ref?, threshold?): SwipeState

Parameters

ref?

RefObject<HTMLElement | null>

threshold?

number = 50

Returns

SwipeState