Skip to content
A react native image previewer !
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Example change github repository name May 2, 2018
__tests__
src
.babelrc
.gitignore
.npmignore
.travis.yml
README.md
index.js
package.json
yarn.lock add test May 5, 2018

README.md

ImagePreviewer Build Statusnpmlicense

image-previewer-demo

Demo gif here if not loaded.

How to use

Install package:

npm install --save rc-image-previewer

Import to your app:

import ImagePreviewer from 'rc-image-previewer';

Use the component:

const { width } = Dimensions.get('window');

export default class App extends React.Component {
  render() {
    const ImgWidth = width;
    const ImgHeight = ImgWidth * 0.6;
    return (
      <View style={{
        flex: 1,
        backgroundColor: '#fff',
        alignItems: 'center',
        justifyContent: 'center',
      }}>
        <ImagePreviewer
          source={MountHuang}
          style={{
            width: ImgWidth,
            height: ImgHeight,
          }}
          resizeMode="stretch"
        />
      </View>
    );
  }
}

API

API table

API name Usage
style The style of element.
source The image source, same as source.
resizeMode The image resize mode, default is contain.(Optional)
You can’t perform that action at this time.