Skip to content

FriendsA/react-single-image-viewer

Repository files navigation

react-single-image-viewer

react image view component

NPM JavaScript Style Guide

Install

npm install --save react-single-image-viewer

Usage

import React, { Component } from 'react'

import ImageView from 'react-single-image-viewer'
import 'react-single-image-viewer/dist/index.css'

class Example extends Component {
  render() {
    return <ImageView src="xxxxx" height="100" width="200" callback="xxxx"/>
  }
}

Params

name description
src img path
height img height
width img width
callback when img load error show path

Example

在线例子

Notice

Because of React hooks,if you want to run test, you need to download react,react-dom yourself,or add them to devDependencies

License

MIT © FriendsA

About

react image viewer components

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors