Buckets:
3.85 GB
70,867 files
Updated 17 days ago
Ctrl+K
| Name | Size | Uploaded | Xet hash |
|---|---|---|---|
| src | 52 items | ||
| dist | 5 items | ||
| package.json | 4.48 kB xet | 988d0b1a | |
| README.md | 6.15 kB xet | c814c34d | |
| LICENSE | 1.06 kB xet | 424e2734 |
๐ผ React Zoom Pan Pinch
Super fast and light react npm package for zooming, panning and pinching html elements in easy way
Sources
Key Features
- ๐ Fast and easy to use
- ๐ญ Light, without external dependencies
- ๐ Mobile gestures, touchpad gestures and desktop mouse events support
- ๐ Powerful context usage, which gives you a lot of freedom
- ๐ง Highly customizable
- ๐ Animations and Utils to create own tools
- ๐ฎ Advanced hooks and components
Try other BetterTyped projects
Do you like this library? Try out other projects
โกHyper Fetch - Fetching and realtime data exchange framework.
Installation
npm install --save react-zoom-pan-pinch
or
yarn add react-zoom-pan-pinch
Examples
import React, { Component } from "react";
import { TransformWrapper, TransformComponent } from "react-zoom-pan-pinch";
const Example = () => {
return (
<TransformWrapper>
<TransformComponent>
<img src="/buckets/Quantumbraid/trainingdata/resolve/ui/node_modules/react-zoom-pan-pinch/image.jpg" alt="test" />
</TransformComponent>
</TransformWrapper>
);
};
or
import React, { Component } from "react";
import {
TransformWrapper,
TransformComponent,
useControls,
} from "react-zoom-pan-pinch";
const Controls = () => {
const { zoomIn, zoomOut, resetTransform } = useControls();
return (
<div className="tools">
<button onClick={() => zoomIn()}>+</button>
<button onClick={() => zoomOut()}>-</button>
<button onClick={() => resetTransform()}>x</button>
</div>
);
};
const Example = () => {
return (
<TransformWrapper
initialScale={1}
initialPositionX={200}
initialPositionY={100}
>
{({ zoomIn, zoomOut, resetTransform, ...rest }) => (
<>
<Controls />
<TransformComponent>
<img src="/buckets/Quantumbraid/trainingdata/resolve/ui/node_modules/react-zoom-pan-pinch/image.jpg" alt="test" />
<div>Example text</div>
</TransformComponent>
</>
)}
</TransformWrapper>
);
};
License
MIT ยฉ prc5
Help me keep working on this project โค๏ธ
๐ Our sponsors
- Total size
- 3.85 GB
- Files
- 70,867
- Last updated
- Nov 3
- Pre-warmed CDN
- US EU US EU