# react-imageview

> A image viewer built with react

Latest version **1.2.1** (published 2017-02-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-imageview
pnpm add react-imageview
yarn add react-imageview
bun add react-imageview
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2017-02-07 |
| First published | 2017-01-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | liaozksysu@gmail.com |
| Maintainers | caesor |
| Keywords | react, imageview |

## Links

- npm: https://www.npmjs.com/package/react-imageview
- Repository: https://github.com/Caesor/react-imageview
- Homepage: https://github.com/Caesor/react-imageview#readme
- Issues: https://github.com/Caesor/react-imageview/issues
- npm.io page: https://npm.io/package/react-imageview

## Dependencies (3)

- [react](https://npm.io/package/react.md) ^15.4.1
- [react-dom](https://npm.io/package/react-dom.md) ^15.4.1
- [react-singleton](https://npm.io/package/react-singleton.md) ^1.3.3

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2017-02-07
- 1.1.2 — 2017-02-05
- 1.1.0 — 2017-01-18
- 1.0.2 — 2017-01-17
- 1.0.1 — 2017-01-12
- 1.0.0 — 2017-01-12

## README

# react-imageview
Imageview component built with react

## Demo
You can find demo in folder [example](https://github.com/Caesor/react-imageview/examples)

## Usage with React

### 1、Install the package
`npm install react-imageview --save`

### 2、Using as your need
```
// Example 1:

import React, { Component } from 'react'
import ImageView from 'react-imageview'

import 'react-imageview/dist/react-imageview.min.css'

class Main extends Component {
    state = {
        showViewer: false
    }
    render() {
        const imagelist = ['./1.png','./2.png','./3.png','./4.png']
        return (
            <div>
                {
                    !!this.state.showViewer && <ImageView imagelist={imagelist} />
                }
                <button onClick={e=>this.show()}>click me to show Alert</button>
            </div>
        )
    }
    show() {
        this.setState({
            showViewer: true
        })
    }
}

// Example 2:

import { SingleImgView } from 'react-imageview'
import 'react-imageview/dist/react-imageview.min.css'

// You can call SingleImgView.show anywhere and anytime, there will be only one View DOM node be added.

const imagelist = ['./1.png','./2.png','./3.png','./4.png']
SingleImgView.show({ imagelist });
```
## Configuration
| Param     | Type     | Description |
| :------------- | :------------- | :------------- |
| imagelist         | array      | The list of images to view |
| disablePinch      | bool       | Disable pinch function |
| disableRotate     | bool       | Disable rotate function |
| disableDoubleTap  | bool       | Disable double tap function |
| longTap           | function   | Events called after the long tap |

## License
Copyright(c) 2016-2017 AlloyTeam. Licensed under MIT license.

---
_Source: https://npm.io/package/react-imageview · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
