Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bettertyped/react-zoom-pan-pinch
๐ผ React library to support easy zoom, pan, pinch on various html dom elements like <img> and <div>
https://github.com/bettertyped/react-zoom-pan-pinch
figma gesture html-manipulation miro pan pinch react react-component svg zoom zoomin zoomout
Last synced: 12 days ago
JSON representation
๐ผ React library to support easy zoom, pan, pinch on various html dom elements like <img> and <div>
- Host: GitHub
- URL: https://github.com/bettertyped/react-zoom-pan-pinch
- Owner: BetterTyped
- License: mit
- Created: 2019-07-14T14:34:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-25T21:34:01.000Z (19 days ago)
- Last Synced: 2024-10-29T17:26:40.620Z (15 days ago)
- Topics: figma, gesture, html-manipulation, miro, pan, pinch, react, react-component, svg, zoom, zoomin, zoomout
- Language: TypeScript
- Homepage:
- Size: 16.2 MB
- Stars: 1,509
- Watchers: 10
- Forks: 273
- Open Issues: 127
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: Contributing.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: Code_of_Conduct.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# ๐ผ React Zoom Pan Pinch
> Super fast and light react npm package for zooming, panning and pinching html
> elements in easy way#### Sources
- [Demo](https://BetterTyped.github.io/react-zoom-pan-pinch/?path=/story/examples-big-image--big-image)
- [Docs](https://BetterTyped.github.io/react-zoom-pan-pinch/?path=/story/docs-props--page)## 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](https://github.com/BetterTyped/hyper-fetch)** - Fetching and
realtime data exchange framework.---
## Installation
```bash
npm install --save react-zoom-pan-pinch
or
yarn add react-zoom-pan-pinch
```## Examples
```jsx
import React, { Component } from "react";import { TransformWrapper, TransformComponent } from "react-zoom-pan-pinch";
const Example = () => {
return (
);
};
```or
```jsx
import React, { Component } from "react";import {
TransformWrapper,
TransformComponent,
useControls,
} from "react-zoom-pan-pinch";const Controls = () => {
const { zoomIn, zoomOut, resetTransform } = useControls();return (
zoomIn()}>+
zoomOut()}>-
resetTransform()}>x
);
};const Example = () => {
return (
{({ zoomIn, zoomOut, resetTransform, ...rest }) => (
<>
Example text
>
)}
);
};
```## License
MIT ยฉ [prc5](https://github.com/prc5)
## Help me keep working on this project โค๏ธ
- [Become a Sponsor on GitHub](https://github.com/sponsors/prc5)
## ๐ Our sponsors