JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/panzoom/panzoom.css"
/>
<style>
#myPanzoom {
max-width: 600px;
height: 400px;
background: #eee;
}
</style>
</head>
<body>
<div>
<div class="f-panzoom" id="myPanzoom">
<img class="f-panzoom__content" src="https://lipsum.app/id/1/1200x1500" />
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/panzoom/panzoom.umd.js"></script>
<script>
const container = document.getElementById("myPanzoom");
const options = { click: "toggleCover" };
new Panzoom(container, options);
</script>
</body>
</html>