Super fast and light react npm package for zooming, panning and pinching html elements in easy way
If your application depends on react-zoom-pan-pinch, I offer paid support to help you resolve issues quickly and avoid blocking releases.
Do you like this library? Here is another BetterTyped project ā the whole preview below is a single link to GitHub.
npm install --save react-zoom-pan-pinch
or
yarn add react-zoom-pan-pinch
import React, { Component } from "react";
import { TransformWrapper, TransformComponent } from "react-zoom-pan-pinch";
const Example = () => {
return (
<TransformWrapper>
<TransformComponent>
<img src="https://raw.githubusercontent.com/BetterTyped/react-zoom-pan-pinch/HEAD/image.jpg" alt="test" />
</TransformComponent>
</TransformWrapper>
);
};
or
import {
TransformWrapper,
TransformComponent,
useControls,
} from "react-zoom-pan-pinch";
const Controls = () => {
const { zoomIn, zoomOut, resetTransform } = useControls();
return (
<div className="tools">
<button type="button" onClick={() => zoomIn()}>
+
</button>
<button type="button" onClick={() => zoomOut()}>
-
</button>
<button type="button" onClick={() => resetTransform()}>
x
</button>
</div>
);
};
const Example = () => {
return (
<TransformWrapper
initialScale={1}
initialPositionX={200}
initialPositionY={100}
>
<Controls />
<TransformComponent>
<img src="https://raw.githubusercontent.com/BetterTyped/react-zoom-pan-pinch/HEAD/image.jpg" alt="test" />
<div>Example text</div>
</TransformComponent>
</TransformWrapper>
);
};
If you're using this library in production, I offer paid support:
Plans start at $400/month.
š© Contact: maciekpyrc@gmail.com
MIT Ā© prc5