Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dwqs/react-native-image-viewer

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dwqs/react-native-image-viewer

A pure JavaScript image viewer component for react-native apps

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-42.86%
Maintainers
1
Weekly downloads
 
Created
Source

download npm-version license

Overview

A pure JavaScript image viewer component for react-native apps with pan, pinch.etc, supporting both iOS and Android.

React Native required 0.33+

Show Cases

On IOS:

viewer-ios

On Android:

viewer-android

Installation

First, install react-native-image-viewer from npm:

npm i @dwqs/react-native-image-viewer --save

Or yarn:

yarn add @dwqs/react-native-image-viewer

Then use it:

// ES6 mudule
import ImageViewer from '@dwqs/react-native-image-viewer';

Usage

There are some code from example/App.js:

let imgsArr = [
    'https://facebook.github.io/react/logo-og.png',
    'http://scimg.jb51.net/allimg/160815/103-160Q509544OC.jpg',
    'http://img.sc115.com/uploads1/sc/jpgs/1508/apic22412_sc115.com.jpg',
    'http://h.hiphotos.baidu.com/zhidao/pic/item/0df431adcbef7609bca7d58a2adda3cc7cd99e73.jpg'
];

closeViewer(){
    this.setState({
        shown:false,
        curIndex:0
    })
}

<ImageViewer shown={this.state.shown}
             imageUrls={imgsArr}
             onClose={this.closeViewer.bind(this)}
             index={this.state.curIndex}>
</ImageViewer>

Configuration

OpthionDescriptionisRequired
shownwhether the ImageViewer is showrequired
imageUrlsit's a array of images' urlrequired
onClosehidden the ImageViewer when click on ImageViewerrequired
indexthe index of image url(in imageUrls) when open the ImageViewerrequired
failedUrlthe url for image preview loaded failurenot required

Feature

  • pan to image toggling
  • double click for image zooming
  • pinch for zoom image
  • animation for image showing

License

MIT

Keywords

FAQs

Package last updated on 26 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc