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

react-image-zoom-on-hover

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-image-zoom-on-hover

A simple React component for zooming images.

0.1.5
latest
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

react-image-zoom-on-hover

A simple React component for zooming images.

Installation

npm install react-image-zoom-on-hover

Basic usage

The component has only one required props: the link to the image.

Usage

import React from 'react';
import { ZoomImage } from 'react-image-zoom-on-hover';

const App = () => {
  return (
    <div>
      <ZoomImage imageUrl="https://example.com/path/to/image.jpg" />
    </div>
  );
};
export default App;

Props

  • imageUrl (required): The URL of the image to be displayed.

  • imageZoomPosition (optional): The position of the zoomed-in image. Can be set to "right" or "left". Defaults to "center" if not specified.

Examples

// Displaying the zoomed-in image on the center (default behavior)
<ZoomImage imageUrl="https://example.com/path/to/image.jpg" />

// Displaying the zoomed-in image on the left
<ZoomImage imageUrl="https://example.com/path/to/image.jpg" imageZoomPosition="left" />

Note

If the imageZoomPosition props is provided, it must have a valid value ("right" or "left"). Not providing this props or providing an invalid value may result in errors or unexpected behavior.

FAQs

Package last updated on 17 Jan 2024

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