use-transform
use-transform
is a no-dependency React library that manages the 2D transformation of a surface i.e. position, rotation, scale. It offers low-level utility functions, and hooks which can be composed to calculate transforms for:
- Multi-touch or mouse or pen input across HTML, SVG, Canvas, WebGL (or anything else)
- Scaling for mouse wheel / touchpad input
- Handles to scale and/or rotate an object around a given point
Note: a polyfill is required for platforms where pointer events are not available.