Drag & drop
usePanZoom
Pans, pinches and zooms content in a box: an image, a map, a diagram. Pan with a finger or the mouse, pinch with two fingers, double tap to zoom.
Pans, pinches and zooms content inside a box: an image, a map, a diagram. It moves the content with its own translate and scale, from its top left corner. One finger or the mouse pans, two fingers pinch, and a double tap zooms in and back out. Hold ctrl and scroll to zoom around the cursor; in Safari, a trackpad pinch does the same. Content stays inside the box, gives a little at the edges, and keeps coasting after a flick. It sets touch-action: none on the box, so the page does not scroll there on touch.
Install
import { usePanZoom } from 'vael-ui'