100%
drag to pan · scroll to zoom
Pan, zoom, and scroll for any JS runtime
Physics-based momentum and bounce. Web, React, React Native — one core engine, thin adapters.
npm install @panscale/core @panscale/web
✓Physics-based momentum & bounce
✓Snap scrolling & pagination
✓Pinch-to-zoom with proper gesture handling
✓Works with images, canvas, WebGL, any element
✓TypeScript-first, tree-shakeable
✓Zero dependencies (core)
Packages
Quick start
import { createWebScaler } from "@panscale/web";
const scaler = createWebScaler(element, {
contentWidth: 1600,
contentHeight: 900,
zooming: true,
bouncing: true,
callback: (values) => {
content.style.transform =
`matrix(${values.zoom},0,0,${values.zoom},${values.translateX},${values.translateY})`;
},
});