Calm motion: animations on this site only fade, with no movement
Loupe
Magnifier over an image on hover or touch
A lens that shows the detail under the pointer: a product photo, a map, a screenshot with small text. For flipping through full-size pictures, use Gallery. For comparing two versions, Compare.
Basic

- The lens is a square centerd on the pointer, showing the spot at
zoomtimes (default 2.5) in a box ofsizepx (default 140). It stays inside the picture, and the picture itself does not move. - On touch, press and drag. The lens rides above the finger so the finger does not cover what is being looked at, and it goes away when you lift. Vertical swipes still scroll the page.
- With the keyboard, focus the picture: the lens appears in the middle, arrow keys move it (Shift for bigger steps) and Esc hides it.
- The lens reads the same file. Pass
zoomSrcwith a larger version so the enlarged view is sharp instead of a blown-up copy. - The lens is purely visual and hidden from screen readers.
altdescribes the picture as usual, so put anything the lens reveals that matters (a label, a number) in the text around it as well.
Usage
ts
import { BlessLoupe } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
src* | string | — | |
alt* | string | — | |
zoomSrc | string | — | a larger version of the same picture for the lens; defaults to `src` |
zoom | number | 2.5 | magnification |
size | number | 140 | side of the square lens, in px |