0.1.6 • Published 5 years ago

react-viewer-mobile v0.1.6

Weekly downloads
31
License
MIT
Repository
github
Last release
5 years ago

react-viewer-mobile

react image viewer for mobile

Introduction

react-viewer for mobile.

Installation

npm install react-viewer-mobile --save

Usage

import * as React from 'react';
import Viewer from 'react-viewer-mobile';
import 'react-viewer-mobile/dist/index.css';

class App extends React.Component<any, any> {
  constructor() {
    super();

    this.state = {
      visible: false,
    };
  }

  render() {
    return (
      <div>
        <button onClick={() => { this.setState({ visible: !this.state.visible }); } }>show</button>
        <Viewer
        visible={this.state.visible}
        images={[src: '', alt: '']}
        />
      </div>
    );
  }
}

Props

propstypedefaultdescriptionrequired
visiblestringfalseViewer visibletrue
images{src: string, alt: string}[][]image source arraytrue
activeIndexnumber0active image indexfalse
zIndexnumber1000Viewer css z-indexfalse

Gesture support

  • slide
  • pinch

License

MIT

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

6 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago