0.1.6 • Published 6 years ago

react-lens-zoom v0.1.6

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

react-lens-zoom

The Simplest Zoom Module for Your React Components

Installation

npm i react-lens-zoom

Usage

import ImageLensZoom from 'react-lens-zoom';

const Example = () => (
  <ImageLensZoom 
    source='https://webkit.org/demos/srcset/image-src.png'
  />
);

Props

PropertyTypeDescriptionMandatory?Default
sourceStringThe Mandatory Image SourceYes-
sourceIdStringUnique Identifier for Source Image element in DOMNosourceImage
destIdStringUnique Identifier for Destination Image element in DOMNodestImage
sourceClassStringAdditional ClassName to Source Image ElementNoaddSourceClass
destClassStringAdditional ClassName to Destination Image ElementNoaddDestClass
sourceWidthStringWidth of the Source ImageNo300
destWidthStringWidth of the Destination ImageNo700
sourceHeightStringHeight of the Source ImageNo300
destHeightStringHeight of the Destination ImageNo500
destSourceStringOptional Destination Image with Higher ResolutionNonull

Methods

  • onLoad() - Function - Callback once the source Image had been loaded. Signifies the point for zoom calculations.

Check out the src/Example for Customized Usage