---
category: Sensors
---
# useSwipe
Reactive swipe detection based on [`TouchEvents`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent).
## Usage
```vue
Swipe here
```
## Type Declarations
```ts
export type UseSwipeDirection = 'up' | 'down' | 'left' | 'right' | 'none';
export interface UseSwipeOptions extends ConfigurableWindow {
/**
* Register events as passive
*
* @default true
*/
passive?: boolean;
/**
* @default 50
*/
threshold?: number;
/**
* Callback on swipe start
*/
onSwipeStart?: (e: TouchEvent) => void;
/**
* Callback on swipe moves
*/
onSwipe?: (e: TouchEvent) => void;
/**
* Callback on swipe ends
*/
onSwipeEnd?: (e: TouchEvent, direction: UseSwipeDirection) => void;
}
export interface UseSwipeReturn {
isSwiping: ShallowRef;
direction: ComputedRef;
coordsStart: Readonly;
coordsEnd: Readonly;
lengthX: ComputedRef;
lengthY: ComputedRef;
stop: () => void;
}
/**
* Reactive swipe detection.
*
* @see https://vueuse.org/useSwipe
* @param target
* @param options
*/
export declare function useSwipe(
target: MaybeRefOrGetter,
options?: UseSwipeOptions,
): UseSwipeReturn;
```