Gathering detailed insights and metrics for react-native-image-zoom-viewer
Gathering detailed insights and metrics for react-native-image-zoom-viewer
Gathering detailed insights and metrics for react-native-image-zoom-viewer
Gathering detailed insights and metrics for react-native-image-zoom-viewer
primeton-react-native-image-zoom-viewer
@react-native-oh-tpl/react-native-image-zoom-viewer
react native image viewer,大图浏览
react-native-image-zoom-viewer-fixed
react native image viewer,大图浏览
react-native-image-zoom-viewer-1
react-native-image-zoom-viewer 在2021年9月28号已停更,这个为 fork 版本,修复了一些 bug 以及少许更新。
🚀 tiny & fast lib for react native image viewer pan and zoom
npm install react-native-image-zoom-viewer
Typescript
Module System
Node Version
NPM Version
TypeScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2,451 Stars
324 Commits
582 Forks
22 Watchers
23 Branches
32 Contributors
Updated on Jul 03, 2025
Latest Version
3.0.1
Package Id
react-native-image-zoom-viewer@3.0.1
Unpacked Size
113.83 kB
Size
24.01 kB
File Count
22
NPM Version
6.14.4
Node Version
12.16.3
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
2
Swiper image
Zoom while sliding
Swipe down
1npm i react-native-image-zoom-viewer --save
1$ npm install -g create-react-native-app
1$ create-react-native-app AwesomeProject
AwesomeProject/App.js
, like this:1import { Modal } from 'react-native'; 2import ImageViewer from 'react-native-image-zoom-viewer'; 3 4const images = [{ 5 // Simplest usage. 6 url: 'https://avatars2.githubusercontent.com/u/7970947?v=3&s=460', 7 8 // width: number 9 // height: number 10 // Optional, if you know the image size, you can set the optimization performance 11 12 // You can pass props to <Image />. 13 props: { 14 // headers: ... 15 } 16}, { 17 url: '', 18 props: { 19 // Or you can set source directory. 20 source: require('../background.png') 21 } 22}] 23 24export default class App extends React.Component { 25 render: function() { 26 return ( 27 <Modal visible={true} transparent={true}> 28 <ImageViewer imageUrls={images}/> 29 </Modal> 30 ) 31 } 32}
parameter | type | required | description | default |
---|---|---|---|---|
imageUrls | array | yes | Image Source | |
enableImageZoom | boolean | no | Enable image zoom | true |
onShowModal | function(content?: JSX.Element) => void | no | The callback for show modal | () => {} |
onCancel | function() => void | no | The callback for cancel modal | () => {} |
flipThreshold | number | no | Swipe threshold of the next page | 80 |
maxOverflow | number | no | The X position maximum, that current page can slide to the next page | 300 |
index | number | no | Init index of images | 0 |
failImageSource | string, object{url: string} | no | placeholder for fail | '' |
loadingRender | function() => React.ReactElement<any> | no | placeholder for loading | () => null |
onSaveToCamera | function(index?: number => void | no | The callback for save to camera | () => {} |
onChange | function(index?: number => void | no | When the image changed | () => {} |
onMove | ( position: IOnMove )=>void | reports movement position data (helpful to build overlays) | ()=> {} | |
saveToLocalByLongPress | boolean | no | Enable save to camera when long press | true |
onClick | function(onCancel?: function) => void | no | Onclick | (onCancel) => {onCancel()} |
onDoubleClick | function(onCancel?: function) => void | no | OnDoubleClick | (onCancel) => {onCancel()} |
onSave | function(url: string) => void | no | The picture is saved to the local method, if you write this method will not call the system default method for Android does not support saveToCameraRoll remote picture, you can call this callback in Android call native interface | |
renderHeader | function(currentIndex?: number) => React.ReactElement<any> | no | Custom header | () => null |
renderFooter | function(currentIndex?: number) => React.ReactElement<any> | no | Custom footer | () => null |
renderIndicator | function(currentIndex?: number, allSize?) => React.ReactElement<any> : number | no | Custom indicator | (currentIndex, allSize) => currentIndex + "/" + allSize |
renderImage | function(props: any) => React.ReactElement<any> | no | Custom image component | (props) => <Image {...props} /> |
renderArrowLeft | function() => React.ReactElement<any> | no | Custom left arrow | () => null |
renderArrowRight | function() => React.ReactElement<any> | no | Custom right arrow | () => null |
onSwipeDown | function() => void | no | Callback for swipe down | () => null |
footerContainerStyle | object{someStyle: someValue} | no | custom style props for container that will be holding your footer that you pass | bottom: 0, position: "absolute", zIndex: 9999 |
backgroundColor | stringwhite | no | Component background color | black |
enableSwipeDown | boolean | no | Enable swipe down to close image viewer. When swipe down, will trigger onCancel. | false |
swipeDownThreshold | number | no | Threshold for firing swipe down function | |
doubleClickInterval | number | no | Double click interval. | |
pageAnimateTime | number | no | Set the animation time for page flipping. | 100 |
enablePreload | boolean | no | Preload the next image | false |
useNativeDriver | boolean | no | Whether to animate using useNativeDriver | false |
menus | function({cancel,saveToLocal}) => React.ReactElement<any> | no | Custom menus, with 2 methods:cancel to hide menus and saveToLocal to save image to camera | |
menuContext | object{someKey: someValue} | no | Custom menu context. | { saveToLocal: 'save to the album', cancel: 'cancel' } |
After clone this repo, then:
1npm install 2npm start
1cd demo 2npm install 3npm start
Then, scan the QR, use your expo app.
Depend on react-native-image-pan-zoom
: https://github.com/ascoders/react-native-image-zoom
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 10/17 approved changesets -- score normalized to 5
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
97 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
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