Skip to content
المشاريع

حول

🔎🖼️ تكبير خفيف للصور على الويب. بلا تبعيات، ويعمل مع أي إطار عمل، ومع React عبر shadcn.

تطوير الويب والتطبيقات

كيف تُقاس هذه الأرقام

النمو المقاس للنجوم

خلال 24 ساعة
؜-١
خلال 7 أيام
+١
خلال 15 يومًا
+١
خلال شهر
+٦

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

medium-zoom

Lightweight image zoom for the web. Zero dependencies, any framework, React via shadcn.

npm version npm downloads MIT license

An image opening with medium-zoom

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 @medium-zoom/image-zoom
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.

Try these runnable examples:

Contributing

See the contributing guide to get started.

License

MIT © François Chalifour

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…