🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

image-zoom-react

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

image-zoom-react

A component react to enlarge images on touch, click, or mouseover. ### Installation `yarn add image-zoom-react` or `npm install --save image-zoom-react` ### Usage ``` import React from 'react' import ReactDom from 'react-dom' import ImageZoom from 'image-

0.1.2
latest
Source
npm
Version published
Weekly downloads
6
-45.45%
Maintainers
1
Weekly downloads
 
Created
Source

Image Zoom React

A component react to enlarge images on touch, click, or mouseover.

Installation

yarn add image-zoom-react or npm install --save image-zoom-react

Usage

import React from 'react'
import ReactDom from 'react-dom'
import ImageZoom from 'image-zoom-react'

const App = () => (
    <ImageZoom src="image url" magnify={1.5} />
)

ReactDom.render(<App />, document.getElementById('app'))

props

propsdefaultdescription
srcrequiredsrc of image
altimagealt of image
zoomSrc''src of zoom image (may be an image in high res)
touchtrueEnables interaction via touch events.
onmouseoverhe type of event that triggers zooming. Choose from mouseover or grab
duration200The fadeIn/fadeOut speed of the large image.
magnify2This value is multiplied against the full size of the zoomed image
onImageLoaded() => {}A function to be called when the image has loaded. Has param is the image element.
onZoomIn() => {}A function to be called when zoom in. Has param is the image element.
onZoomOut() => {}A function to be called when zoom out. Has param is the image element.

FAQs

Package last updated on 24 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts