A loupe that glides over a photo and magnifies its finest details
| Name | Type | Default | Description |
|---|---|---|---|
src | string | Where’s Waldo? | Image shown in the frame. |
zoomSrc | string | src | Higher-resolution copy used inside the loupe. It loads in the background and fades in to reveal more detail. |
alt | string | "Where’s Waldo? illustrated crowd scene" | Accessible description of the image. |
aspectRatio | number | "auto" | "auto" | Width divided by height of the frame. Auto follows the image once it loads. |
fit | "cover" | "contain" | "cover" | How the image fills the frame. The magnified view always matches it exactly. |
focusX | number | 50 | Horizontal crop anchor in percent when the image is cropped. |
focusY | number | 50 | Vertical crop anchor in percent when the image is cropped. |
radius | number | 18 | Corner radius of the frame in pixels. |
mode | "lens" | "inline" | "lens" | A loupe over the image, or the whole frame zooming in and panning with the pointer. |
zoom | number | 2 | Magnification. |
minZoom | number | 1.25 | Lowest magnification reachable with pinch, wheel or keys. |
maxZoom | number | 4 | Highest magnification reachable with pinch, wheel or keys. |
boost | number | 2 | Press and hold to bring the loupe closer: magnification multiplies by this while held. 1 turns it off. |
wheelZoom | "pinch" | "wheel" | "off" | "pinch" | Change magnification with a trackpad pinch (or Ctrl and the wheel), with the plain wheel, or not at all. Pinch keeps page scrolling untouched. |
lensSize | number | 180 | Height of the loupe in pixels. It shrinks to fit small frames. |
lensAspect | number | 1 | Width divided by height of the loupe. Above 1 gives a wide reading lens. |
shape | "circle" | "rounded" | "circle" | A round loupe (a capsule when wide) or a rounded rectangle. |
lensRadius | number | 18 | Corner radius of the rounded loupe in pixels. |
rim | "none" | "hairline" | "glass" | "solid" | "glass" | Edge of the loupe: none, a fine line, a lit glass rim, or a solid band. |
rimWidth | number | 3 | Width of the glass or solid rim in pixels. |
rimColor | string | "#FFFFFF" | Colour of the rim and the reticle. |
backgroundColor | string | "transparent" | Fill behind the image, visible when it is contained. |
shadow | number | 0.6 | Strength of the shadow under the loupe, from 0 to 1. |
dim | number | 0.25 | How much the image around the loupe darkens while it is in use, from 0 to 1. |
reticle | "none" | "dot" | "cross" | "corners" | "none" | A fine mark in the loupe: a centre dot, a crosshair or viewfinder corners. |
showZoom | boolean | true | Show the magnification beside the loupe for a moment whenever it changes. |
smoothing | number | 0.35 | How much weight the loupe has as it follows the pointer, from 0 (none) to 1. |
overhang | boolean | false | Let the loupe hang past the edge of the frame instead of stopping at it. |
hideCursor | boolean | true | Hide the system cursor while the loupe is in use. |
touchOffset | number | 72 | On touch, hold to bring up the loupe this many pixels above your finger so it never covers what you inspect. A quick tap peeks. |
onZoomChange | (zoom) => void | — | Called when the reader changes the magnification. |
ref | { show, hide, setZoom } | — | show(x?, y?) opens the loupe at a point given in fractions of the frame, hide() closes it, setZoom(zoom) sets the magnification. |
className | string | — | Classes for the frame. It is as wide as its parent and its height follows the aspect ratio. |
style | CSSProperties | — | Inline styles for the frame. |
srcstringImage shown in the frame.
Where’s Waldo?zoomSrcstringHigher-resolution copy used inside the loupe. It loads in the background and fades in to reveal more detail.
srcaltstringAccessible description of the image.
"Where’s Waldo? illustrated crowd scene"aspectRationumber | "auto"Width divided by height of the frame. Auto follows the image once it loads.
"auto"fit"cover" | "contain"How the image fills the frame. The magnified view always matches it exactly.
"cover"focusXnumberHorizontal crop anchor in percent when the image is cropped.
50focusYnumberVertical crop anchor in percent when the image is cropped.
50radiusnumberCorner radius of the frame in pixels.
18mode"lens" | "inline"A loupe over the image, or the whole frame zooming in and panning with the pointer.
"lens"zoomnumberMagnification.
2minZoomnumberLowest magnification reachable with pinch, wheel or keys.
1.25maxZoomnumberHighest magnification reachable with pinch, wheel or keys.
4boostnumberPress and hold to bring the loupe closer: magnification multiplies by this while held. 1 turns it off.
2wheelZoom"pinch" | "wheel" | "off"Change magnification with a trackpad pinch (or Ctrl and the wheel), with the plain wheel, or not at all. Pinch keeps page scrolling untouched.
"pinch"lensSizenumberHeight of the loupe in pixels. It shrinks to fit small frames.
180lensAspectnumberWidth divided by height of the loupe. Above 1 gives a wide reading lens.
1shape"circle" | "rounded"A round loupe (a capsule when wide) or a rounded rectangle.
"circle"lensRadiusnumberCorner radius of the rounded loupe in pixels.
18rim"none" | "hairline" | "glass" | "solid"Edge of the loupe: none, a fine line, a lit glass rim, or a solid band.
"glass"rimWidthnumberWidth of the glass or solid rim in pixels.
3rimColorstringColour of the rim and the reticle.
"#FFFFFF"backgroundColorstringFill behind the image, visible when it is contained.
"transparent"shadownumberStrength of the shadow under the loupe, from 0 to 1.
0.6dimnumberHow much the image around the loupe darkens while it is in use, from 0 to 1.
0.25reticle"none" | "dot" | "cross" | "corners"A fine mark in the loupe: a centre dot, a crosshair or viewfinder corners.
"none"showZoombooleanShow the magnification beside the loupe for a moment whenever it changes.
truesmoothingnumberHow much weight the loupe has as it follows the pointer, from 0 (none) to 1.
0.35overhangbooleanLet the loupe hang past the edge of the frame instead of stopping at it.
falsehideCursorbooleanHide the system cursor while the loupe is in use.
truetouchOffsetnumberOn touch, hold to bring up the loupe this many pixels above your finger so it never covers what you inspect. A quick tap peeks.
72onZoomChange(zoom) => voidCalled when the reader changes the magnification.
—ref{ show, hide, setZoom }show(x?, y?) opens the loupe at a point given in fractions of the frame, hide() closes it, setZoom(zoom) sets the magnification.
—classNamestringClasses for the frame. It is as wide as its parent and its height follows the aspect ratio.
—styleCSSPropertiesInline styles for the frame.
—