Home

Awesome

react-native-transformable-image

A pure JavaScript written transformable image component, like PhotoView or ImageViewer, supports gestures like pan, pinch, double tab and fling, works with both iOS and Android.

Written in pure JS, this component should be one of the most easy to use component among all the zoomable, scrollable PhotoView alike views on react-native.

Install

npm install --save react-native-transformable-image@latest

Required installation for cache={true} only

react-native-fetch-blob

This package has a dependency with react-native-fetch-blob. If your project doesn't have a dependency with this package already, please refer to their installation instructions.

Usage

Quite same as the official Image, as below shows:

import Image from 'react-native-transformable-image';
...
render() {
    return (
      ...
        <Image
          style={{width: width, height: height}}
          source={{uri: 'https://raw.githubusercontent.com/yoaicom/resources/master/images/game_of_thrones_1.jpg'}}
          //pixels={{width: 3607, height: 2400}}
        />
      ...
    );
  }

You can provide enableTransform, enableScale and enableTranslate props to control corresponding features.

Other props

​ inherited from react-native-view-transformer

Attention

Image Gallery

If you are looking for an image gallery component, please refer to react-native-gallery, which is based on this component.