# @sp1985/react-zoom-pan-pinch

> React package for zooming, panning and pinching html elements in an easy way.

Latest version **2.4.6** (published 2023-01-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sp1985/react-zoom-pan-pinch
pnpm add @sp1985/react-zoom-pan-pinch
yarn add @sp1985/react-zoom-pan-pinch
bun add @sp1985/react-zoom-pan-pinch
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.4.6 |
| Published | 2023-01-09 |
| First published | 2023-01-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 1.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | sp1985 |
| Maintainers | sp1985 |
| Keywords | pan, pinch, react, scale, svg, touch, typescript, zoom |

## Links

- npm: https://www.npmjs.com/package/@sp1985/react-zoom-pan-pinch
- Repository: https://github.com/sp1985/react-zoom-pan-pinch
- Homepage: https://github.com/sp1985/react-zoom-pan-pinch#readme
- Issues: https://github.com/sp1985/react-zoom-pan-pinch/issues
- npm.io page: https://npm.io/package/@sp1985/react-zoom-pan-pinch

## 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

- 2.4.6 (latest) — 2023-01-09

## README

# @pronestor/react-zoom-pan-pinch

Super fast and light react Node.js package for zooming, panning and pinching html elements in an easy way.

This is a fork of [react-zoom-pan-pinch](https://github.com/prc5/react-zoom-pan-pinch) originally created in order to fix [the issue with build errors because of missing source files](https://github.com/prc5/react-zoom-pan-pinch/issues/265).

## Documentation

[Storybook for `@pronestor/react-zoom-pan-pinch`](https://pronestoraps.github.io/react-zoom-pan-pinch/).

## Quick Start

### Installation

```shell
yarn add @pronestor/react-zoom-pan-pinch
```

or

```shell
npm install @pronestor/react-zoom-pan-pinch
```

### Usage

Basic usage:

```jsx
import {
  TransformComponent,
  TransformWrapper,
} from "@pronestor/react-zoom-pan-pinch";

export const SimpleExample = () => (
  <TransformWrapper>
    <TransformComponent>
      <img src="image.jpg" alt="test" />
    </TransformComponent>
  </TransformWrapper>
);
```

With controls:

```jsx
import {
  TransformComponent,
  TransformWrapper,
} from "@pronestor/react-zoom-pan-pinch";

export const ExampleWithZoomControls = () => (
  <TransformWrapper
    initialPositionX={200}
    initialPositionY={100}
    initialScale={1}
  >
    {({ zoomIn, zoomOut, ...rest }) => (
      <>
        <div className="tools">
          <button onClick={() => zoomIn()}>+</button>
          <button onClick={() => zoomOut()}>-</button>
        </div>
        <TransformComponent>
          <img src="image.jpg" alt="test" />
          <div>Example text</div>
        </TransformComponent>
      </>
    )}
  </TransformWrapper>
);
```

## License

MIT © [Pronestor](https://github.com/proNestorAps)

---
_Source: https://npm.io/package/@sp1985/react-zoom-pan-pinch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
