francoischalifour/medium-zoom
francoischalifour/medium-zoom has 3,942 GitHub stars and 168 forks. GitHot measured 0 stars in 24 hours and +3 in 7 days. Last checked 2026-11-13 08:52 UTC. Last push 2026-11-02.
🔎🖼️ Lightweight image zoom for the web. Zero dependencies, any framework, React via shadcn.
Measured star growth
- in 24h
- 0
- in 7 days
- +3
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Original
medium-zoom
Lightweight image zoom for the web. Zero dependencies, any framework, React via shadcn.
JavaScript
Install the package:
npm install medium-zoom
Add an image to your page:
<img src="/photo.jpg" alt="A mountain at sunrise" data-zoomable />
After the image is in the document, initialize the zoom:
import mediumZoom from 'medium-zoom'
mediumZoom('[data-zoomable]')
The standard import includes styles and TypeScript definitions. Click the image to zoom. Click again, press esc, or scroll to close it.
The JavaScript quickstart covers script tags, separate stylesheets, and browser support. See the API reference for selectors, options, methods, and events.
React
In a project configured for shadcn/ui, install the component:
npx shadcn@latest add https://medium-zoom.francoischalifour.com/r/image-zoom.json
import { ImageZoom } from '@/components/ui/image-zoom'
export function Photo() {
return <ImageZoom src="/photo.jpg" alt="A mountain at sunrise" />
}
The command copies the component and stylesheet into your project and installs medium-zoom. The component provides a keyboard-accessible button and manages zoom state and cleanup.
Follow the React quickstart or use the component reference to customize it.
Guides and examples
The documentation covers HD images, galleries, styling, and the JavaScript and React APIs.
Runnable examples include plain JavaScript, React, Vue, and Svelte. The React example demonstrates using the library directly; shadcn/ui demonstrates the installable component.
Contributing
See Contributing for setup, development commands, verification, and releases. To work on the website, see its development guide.
License
Explore related projects
freeCodeCamp/freeCodeCamp
freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.
459,072 starsdonnemartin/system-design-primer
Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.
377,747 starsreact/react
The library for web and native user interfaces.
252,569 starsvuejs/vue
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
212,526 stars