Medium-zoom is a JavaScript library for zooming images like Medium.
The library solves the problem of adding polished image zoom interactions to web pages without requiring a heavy framework dependency. It works by attaching click handlers to images, expanding them to fill the viewport with smooth animations while dimming the background, and allowing users to close the zoom by clicking elsewhere, pressing a key, or scrolling. The approach prioritizes performance, targeting 60 frames per second, and supports loading higher-definition versions of images on demand during zoom.
Developers should choose this tool if they need a lightweight, dependency-free zoom interaction for image-heavy sites or documentation. It suits projects where bundle size matters and where Medium-style image interactions enhance user experience without requiring framework-specific bindings. The library is framework agnostic and integrates with React, Vue, Angular, Svelte, Solid, and other frameworks. It offers customization through options for margin, background color, and scroll offset, event handling for zoom state changes, and the ability to apply zoom to selected images rather than all images on a page.
The project maintains active engagement with issues and pull requests, with consistent attention to bug reports and feature requests from users. Development includes regular updates to dependencies and tooling to keep the codebase current. The maintainer actively responds to community questions and contributions, indicating ongoing stewardship of the library.