Bring images closer with JavaScript
Lightweight image zoom for the web.
Zero dependencies, any framework, React via shadcn.
npm install medium-zoom
pnpm add medium-zoom
yarn add medium-zoom
bun add medium-zoom
Try the zoom.
Scroll to explore
Ocean sunsetPress Enter or Space to zoom. Click, press Escape, or scroll to close.
Garden catPress Enter or Space to zoom. Click, press Escape, or scroll to close.
Denali at sunrisePress Enter or Space to zoom. Click, press Escape, or scroll to close.
Earth from spacePress Enter or Space to zoom. Click, press Escape, or scroll to close.
Roosevelt ArchPress Enter or Space to zoom. Click, press Escape, or scroll to close.
Aurora over YellowstonePress Enter or Space to zoom. Click, press Escape, or scroll to close.
3 kB. Zero dependencies.
A lightweight lightbox alternative.
Any framework. TypeScript ready.
Use with React, Angular, Vue, Svelte, Astro, or plain HTML.
High-resolution on demand.
Load sharper images only when zooming.
Pick your images.
Add data-zoomable to your images, then attach the zoom. Styles come included.
app.js
import mediumZoom from 'medium-zoom'
mediumZoom('[data-zoomable]', {
margin: 24,
background: 'var(--background, #fff)',
})Set the spacing, match your background, or load a sharper image on zoom. Read the API reference
Start with your stack.
The same zoom, wherever you build.
React + TypeScript
A component you own.
Install with the shadcn CLI. Own the source. Match your theme.
Explore shadcn/uiAdd zoom to your project.
Start with a few lines of JavaScript.
npm install medium-zoom
pnpm add medium-zoom
yarn add medium-zoom
bun add medium-zoom