react-image-zooms
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

react-image-zooms

A click on the react component of the zoom in image Demo

npm version npm version

Installation

npm i -S react-image-zooms

Usage

You need to limit the width and height of the image, it's recommended to use a sized container wrapper component.

.image-box {
  width: 200px;
  height: 200px;
}
 
.image-box img {
  width: 100%;
  height: 100%;
}
import ImageZooms from 'react-image-zooms';
import 'react-image-zooms/lib/image-zooms.css';
 
<div className="image-box">
  <ImageZooms src="some image url" duration={300} imageBoxSize={600} />;
</div>;

Props

You may want to specify props:

  • src: required - online image url
  • duration: optional - zoom in image takes time, default: 300
  • imageBoxSize: optional - the maximum width and height of the enlarged image, default:500

License

Licensed under MIT license.

Package Sidebar

Install

npm i react-image-zooms

Weekly Downloads

5

Version

1.0.3

License

MIT

Unpacked Size

10.8 kB

Total Files

6

Last publish

Collaborators

  • tgxh