百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

react-native-image-viewer

> 前端框架
开源

一个小巧而快速的库,用于 React Native 图像浏览器的平移和缩放

2.4K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个小巧而快速的库,用于 React Native 图像浏览器的平移和缩放

## Show Cases **Swiper image** **Zoom while sliding** **Swipe down** ## Getting Started ### Installation ```bash npm i react-native-image-zoom-viewer --save ``` ### Basic Usage - Install create-react-native-app first ```bash $ npm install -g create-react-native-app ``` - Initialization of a react-native project ```bash $ create-react-native-app AwesomeProject ``` - Then, edit `AwesomeProject/App.js`, like this: ``` … ``` ### Props | 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` | 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](https://github.com/ascoders/react-native-image-zoom/blob/master/src/image-zoom/image-zoom.type.ts) )=>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` | no | Custom header | `() => null` | | renderFooter | function

`(currentIndex?: number) => React.ReactElement` | no | Custom footer | `() => null` | | renderIndicator | function

`(currentIndex?: number, allSize?) => React.ReactElement`: number | no | Custom indicator | `(currentIndex, allSize) => currentIndex + "/" + allSize` | | renderImage | function

`(props: any) => React.ReactElement` | no | Custom image component | `(props) => ` | | renderArrowLeft | function

`() => React.ReactElement` | no | Custom left arrow | `() => null` | | renderArrowRight | function

`() => React.ReactElement` | 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 | string

`white` | no | Component background color | `black` | | enableSwipeDown | boolean | no | Enable swipe down to close image viewer. When swipe down, will trigger onCancel.

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

核心特点

  • •Install create-react-native-app first
  • •Initialization of a react-native project
  • •Then, edit AwesomeProject/App.js, like this:

> 标签

TypeScriptimage-viewerreact-componentreact-native

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架