🖼 React library to support easy zoom, pan, pinch on various html dom elements like <img> and <div>
Installations
npm install react-zoom-pan-pinch
Developer Guide
Typescript
Yes
Module System
CommonJS
Min. Node Version
>=8
Node Version
16.20.2
NPM Version
8.19.4
Score
94
Supply Chain
95.4
Quality
85.4
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (83.3%)
MDX (14.24%)
JavaScript (1.18%)
CSS (1.16%)
HTML (0.12%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
prc5
Download Statistics
Total Downloads
36,894,170
Last Day
12,794
Last Week
403,494
Last Month
1,560,574
Last Year
16,089,003
GitHub Statistics
MIT License
1,610 Stars
410 Commits
286 Forks
11 Watchers
8 Branches
45 Contributors
Updated on Feb 17, 2025
Bundle Size
33.00 kB
Minified
10.07 kB
Minified + Gzipped
Package Meta Information
Latest Version
3.7.0
Package Id
react-zoom-pan-pinch@3.7.0
Unpacked Size
431.13 kB
Size
81.92 kB
File Count
8
NPM Version
8.19.4
Node Version
16.20.2
Published on
Jan 31, 2025
Total Downloads
Cumulative downloads
Total Downloads
36,894,170
Last Day
6.8%
12,794
Compared to previous day
Last Week
3.4%
403,494
Compared to previous week
Last Month
32.9%
1,560,574
Compared to previous month
Last Year
63.5%
16,089,003
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
69
🖼 React Zoom Pan Pinch
Super fast and light react npm package for zooming, panning and pinching html elements in easy way
Sources
Key Features
- 🚀 Fast and easy to use
- 🏭 Light, without external dependencies
- 💎 Mobile gestures, touchpad gestures and desktop mouse events support
- 🎁 Powerful context usage, which gives you a lot of freedom
- 🔧 Highly customizable
- 👑 Animations and Utils to create own tools
- 🔮 Advanced hooks and components
Try other BetterTyped projects
Do you like this library? Try out other projects

⚡Hyper Fetch - Fetching and realtime data exchange framework.
Installation
1npm install --save react-zoom-pan-pinch 2or 3yarn add react-zoom-pan-pinch
Examples
1import React, { Component } from "react"; 2 3import { TransformWrapper, TransformComponent } from "react-zoom-pan-pinch"; 4 5const Example = () => { 6 return ( 7 <TransformWrapper> 8 <TransformComponent> 9 <img src="image.jpg" alt="test" /> 10 </TransformComponent> 11 </TransformWrapper> 12 ); 13};
or
1import React, { Component } from "react"; 2 3import { 4 TransformWrapper, 5 TransformComponent, 6 useControls, 7} from "react-zoom-pan-pinch"; 8 9const Controls = () => { 10 const { zoomIn, zoomOut, resetTransform } = useControls(); 11 12 return ( 13 <div className="tools"> 14 <button onClick={() => zoomIn()}>+</button> 15 <button onClick={() => zoomOut()}>-</button> 16 <button onClick={() => resetTransform()}>x</button> 17 </div> 18 ); 19}; 20 21const Example = () => { 22 return ( 23 <TransformWrapper 24 initialScale={1} 25 initialPositionX={200} 26 initialPositionY={100} 27 > 28 {({ zoomIn, zoomOut, resetTransform, ...rest }) => ( 29 <> 30 <Controls /> 31 <TransformComponent> 32 <img src="image.jpg" alt="test" /> 33 <div>Example text</div> 34 </TransformComponent> 35 </> 36 )} 37 </TransformWrapper> 38 ); 39};
License
MIT © prc5
Help me keep working on this project ❤️
💖 Our sponsors

No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 20/30 approved changesets -- score normalized to 6
Reason
3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/docs.yml:1
- Warn: no topLevel permission defined: .github/workflows/release.yml:1
- Warn: no topLevel permission defined: .github/workflows/tests.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/BetterTyped/react-zoom-pan-pinch/docs.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docs.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/BetterTyped/react-zoom-pan-pinch/docs.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/BetterTyped/react-zoom-pan-pinch/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/BetterTyped/react-zoom-pan-pinch/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/BetterTyped/react-zoom-pan-pinch/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/BetterTyped/react-zoom-pan-pinch/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/BetterTyped/react-zoom-pan-pinch/tests.yml/master?enable=pin
- Info: 0 out of 6 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 third-party GitHubAction dependencies pinned
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 20 are checked with a SAST tool
Reason
45 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q
- Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38
- Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6
- Warn: Project is vulnerable to: GHSA-434g-2637-qmqr
- Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m
- Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw
- Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p
- Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747
- Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh
- Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc
- Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-8mmm-9v2q-x3f9
- Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-w5hq-hm5m-4548
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-w5p7-h5w8-2hfq
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j
- Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986
- Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
3.6
/10
Last Scanned on 2025-02-10
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 MoreOther packages similar to react-zoom-pan-pinch
react-quick-pinch-zoom
A react component that providing multi-touch gestures for zooming and dragging on any DOM element.
@pronestor/react-zoom-pan-pinch
React package for zooming, panning and pinching html elements in an easy way.
react-responsive-pinch-zoom-pan
Enables zooming and panning an image, both mobile and desktop.
react-pinch-zoom-pan
A react component that lets you add pinch-zoom and pan sub components