RE

React Zoom Pan Pinch

react-zoom-pan-pinch

Zoom and pan html elements in easy way.

Forms
react
zoom
pan
pinch
animation
velocity
css
fast
transformations
scale
Stars
1
Weekly
0
Open issues
0
Bundle
~60 kB

Installation

npm install react-zoom-pan-pinch

Code example

import { useZoomPanPinch } from "react-zoom-pan-pinch";

export function Example() {
  const form = useZoomPanPinch({ defaultValues: { email: "" } });

  function onSubmit(event: React.FormEvent<HTMLFormElement>) {
    event.preventDefault();
    console.log(form);
  }

  return (
    <form onSubmit={onSubmit}>
      <input name="email" type="email" placeholder="you@example.com" />
      <button type="submit">Submit</button>
    </form>
  );
}

Pros & cons

Pros

  • Actively maintained by prc5
  • 0 weekly downloads. Battle tested
  • First-class TypeScript definitions
  • MIT licensed

Considerations

  • Adds roughly ~60 kB to your bundle
  • Needs client-only rendering in SSR frameworks
  • Not supported in React Native
  • 0 open issues on GitHub

FAQs

Alternatives & similar libraries