English | 中文
A simple pinch-zoom component for React, Support dragging and zooming elements.
pnpm add @lsbcc/react-pinch-zoom
-
ZoomImage
ComponentSupport dragging and zooming images.
import { ZoomImage } from '@lsbcc/react-pinch-zoom';
function App() {
const imgUrl = 'https://www.example.com/a.png';
return (
<ZoomImage
style={{ width: '100vw' }}
maxScale={10}
minScale={0.5}
src={imgUrl}
/>
);
}
export default App;
-
ZoomImage
ComponentName Description Type Default src Image path string - maxScale Maximum scale of the image number 3 minScale Minimum scale of the image number 1