Gathering detailed insights and metrics for react-use-gesture
Gathering detailed insights and metrics for react-use-gesture
Gathering detailed insights and metrics for react-use-gesture
Gathering detailed insights and metrics for react-use-gesture
👇Bread n butter utility for component-tied mouse/touch gestures in React and Vanilla Javascript.
npm install react-use-gesture
Typescript
Module System
Node Version
NPM Version
98.1
Supply Chain
93.9
Quality
78.3
Maintenance
100
Vulnerability
100
License
@use-gesture/vanilla@10.3.1
Updated on Mar 21, 2024
@use-gesture/react@10.3.1
Updated on Mar 21, 2024
@use-gesture/core@10.3.1
Updated on Mar 21, 2024
@use-gesture/vanilla@10.3.0
Updated on Sep 16, 2023
@use-gesture/react@10.3.0
Updated on Sep 16, 2023
@use-gesture/core@10.3.0
Updated on Sep 16, 2023
TypeScript (98.85%)
JavaScript (1.11%)
Shell (0.04%)
Total Downloads
45,598,456
Last Day
13,464
Last Week
229,047
Last Month
1,027,178
Last Year
10,791,708
MIT License
9,399 Stars
1,360 Commits
318 Forks
43 Watchers
11 Branches
92 Contributors
Updated on Jul 07, 2025
Minified
Minified + Gzipped
Latest Version
9.1.3
Package Id
react-use-gesture@9.1.3
Size
260.11 kB
NPM Version
7.5.4
Node Version
12.18.4
Published on
Mar 07, 2021
Cumulative downloads
Total Downloads
Last Day
0.1%
13,464
Compared to previous day
Last Week
-7.5%
229,047
Compared to previous week
Last Month
1.8%
1,027,178
Compared to previous month
Last Year
-4.7%
10,791,708
Compared to previous year
1
29
React UseGesture is a hook that lets you bind richer mouse and touch events to any component or view. With the data you receive, it becomes trivial to set up gestures, and often takes no more than a few lines of code.
You can use it stand-alone, but to make the most of it you should combine it with an animation library like react-spring, though you can most certainly use any other.
The demos are real click them!
1#Yarn 2yarn add react-use-gesture 3 4#NPM 5npm install react-use-gesture
1import { useSpring, animated } from 'react-spring' 2import { useDrag } from 'react-use-gesture' 3 4function PullRelease() { 5 const [{ x, y }, set] = useSpring(() => ({ x: 0, y: 0 })) 6 7 // Set the drag hook and define component movement based on gesture data 8 const bind = useDrag(({ down, movement: [mx, my] }) => { 9 set({ x: down ? mx : 0, y: down ? my : 0 }) 10 }) 11 12 // Bind it to a component 13 return <animated.div {...bind()} style={{ x, y, touchAction: 'none' }} />
The example above makes a div
draggable so that it follows your mouse on drag, and returns to its initial position on release.
Make sure you always set touchAction
on a draggable element to prevent glitches with the browser native scrolling on touch devices.
React-use-gesture exports several hooks that can handle different gestures:
Hook | Description |
---|---|
useDrag | Handles the drag gesture |
useMove | Handles mouse move events |
useHover | Handles mouse enter and mouse leave events |
useScroll | Handles scroll events |
useWheel | Handles wheel events |
usePinch | Handles the pinch gesture |
useGesture | Handles multiple gestures in one hook |
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 4/24 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
65 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More