# react-image-magnifier

> A react component that accepts a high-res source image and produces a magnifier window on mouse hover over the part of the image the cursor is over

Latest version **1.0.0** (published 2015-05-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-image-magnifier
pnpm add react-image-magnifier
yarn add react-image-magnifier
bun add react-image-magnifier
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-05-30 |
| First published | 2015-05-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 38 |
| Author | Leland Richardson |
| Maintainers | intelligibabble |
| Keywords | react, react-component, image, magnifier |

## Links

- npm: https://www.npmjs.com/package/react-image-magnifier
- Repository: https://github.com/lelandrichardson/react-image-magnifier
- Homepage: https://github.com/lelandrichardson/react-image-magnifier#readme
- Issues: https://github.com/lelandrichardson/react-image-magnifier/issues
- npm.io page: https://npm.io/package/react-image-magnifier

## Dependencies (1)

- [react](https://npm.io/package/react.md) ^0.13.3

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-05-30

## README

# react-image-magnifier
A react component that accepts a high-res source image and produces a magnifier window on mouse hover over the part of the image the cursor is over


## Demo

![](http://media.giphy.com/media/xTiTnidsMNlZlf9I2c/giphy.gif)


## Usage

```bash
> npm install --save react-image-magnifier
```

```jsx
var ImageMagnifer = require('react-image-magnifier');

var App = React.createClass({

    render () {
        return (
            <ImageMagnifier
                image={{
                    src: "img/beach-small.jpg",
                    width: 400,
                    height: 300
                }}
                zoomImage={{
                    src: "img/beach-large.jpg",
                    width: 1600,
                    height: 1200
                }}
                cursorOffset={{ x: 80, y: -80 }}
            />
        );
    }
});
```

## API (props)

| Prop | Required | Default  | Type | Description |
| :------------ |:---:|:---------------:| :---------------| :-----|
| `image` | YES | | `{ src, width, height }` | the src, size of the non-zoomed-in image |
| `zoomImage` | YES | | `{ src, width, height }` | the src, size of the zoomed-in image |
| `cursorOffset` | NO | `{ x: 0, y: 0 }` | `{ x, y }` | the offset of the zoom bubble from the cursor |
| `size` | NO | `200` | `Number` | the size of the magnifier window |

---
_Source: https://npm.io/package/react-image-magnifier · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
