1.0.2 • Published 1 year ago

react-single-image-zoom v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-single-image-zoom

react-single-image-zoom is a React component that allows for easy image zoom functionality on wheel events within your React applications.

Features

  • Simple integration with React applications.
  • Zoom in/out functionality triggered by mouse wheel events.
  • Customizable styles via className or inline style.
  • Support for TypeScript.

react-image-zoom-example

Installation

Install the component using npm:

npm i react-single-image-zoom

Usage

To use the component, import it and wrap your image element:

import React from 'react';
import ImageZoom from 'react-single-image-zoom';

const MyComponent = () => {
  return (
    <ImageZoom
          src={"https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQgByBT5IiAT_a2x9pUVb4VMoOrlzHH7Jrzj-HB5jzHlR4lNLMS"}
          name={"dog"}
          containerClassName={"imageContainer"}
          containerStyle={{ width: "auto", height: "auto" }}
          imageClassName={"imageClassName"}
          imageStyle={{ width: "auto", height: "auto" }}
      />
  );
};

export default MyComponent;

Props

PropTypeDescription
srcstringThe source URL of the image.
namestringAlt text for the image.
containerClassNamestring (optional)Custom class for the image container.
containerStyleobject (optional)Inline style for the image container.
imageClassNamestring (optional)Custom class for the image itself.
imageStyleobject (optional)Inline style for the image.

Contributing

If you have any suggestions or improvements, feel free to create issues or pull requests on the GitHub repository.

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago