1.0.2 • Published 4 years ago

react-zoomable-img v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

react-zoomable-img

A React Component that adds a smooth zoom on hover to images.

NPM JavaScript Style Guide

Install

npm install --save react-zoomable-img

Usage

import React, { Component } from 'react'

import ZoomableImage from 'react-zoomable-img'

class Example extends Component {
  render() {
    return  <ZoomableImage src='img/foo.jpg' alt='some alt text' zoomScale={3} onClick={someFunction} transitionDuration={0.5}/>
  }
}

Props

Prop NameTypeDefault valueDescription
srcstring--the source of the image
zoomScalenumber2control the zoom scale of the image
transitionDurationnumber0.1control speed of the zoom transition (seconds)
altstring''alt text
onClickfunctionon image click function
classNamestringadd a className to the image

License

MIT © imadat24