usezoomimage
v1.1.0
Published
### Expand images to full screen with smooth animation
Downloads
7
Readme
useZoomImage
Expand images to full screen with smooth animation
Example
import { useZoomImage } from 'usezoomimage';
function App() {
const [showImage, setShowImage] = React.useState(false);
const [ref, ExpandedImage] = useZoomImage(showImage, { backdrop: true });
return (
<div>
<img ref={ref} src={PlaceholderImage} alt="Placeholder Image" onClick={() => setShowImage(true)} />
{showImage && <ExpandedImage backdropOnClick={() => setShowImage(false)} />}
</div>
);
};