Skip to content
IndexRequest a UIAboutContact

Magnifier Glass Lens

A round glass lens that follows the pointer and magnifies the content under it; arrow keys move it too.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Product photograph of a round glass magnifier lens resting on a printed page of fine technical text, the text inside the lens enlarged three times with crisp edges and slight colour fringing at the rim, a thin silver ring around the glass, a soft white highlight arc at the upper left, shallow depth of field on the surrounding paper, neutral soft light. Negative: distorted lens, fingerprints, broken text, heavy vignette, extra objects. Reduced motion: static image with the lens in the middle.

About this pattern

Definition

A loupe shows a zoomed copy of the content under a small round window. Cloning the content, scaling it and offsetting it so the point under the pointer sits in the lens centre is all it takes, plus a rim and a highlight to make it feel like glass.

Purpose & UX principles

  • The clone must be positioned so that the pointer location maps to the centre of the lens: translate by lens radius minus pointer times zoom.
  • Add a thin bright rim, a soft inner shadow and a small highlight arc for the glass feel.
  • Useful for product images, maps, and charts with fine detail.

Interaction states

  • A Zoom slider, pointer movement, drag and arrow keys.

Motion specification

  • The lens follows the pointer directly with no easing, so it feels attached to the hand.
  • Reduced motion: unaffected, because the movement is driven by the user.

Responsive behaviour

  • On touch, drag the lens; also support arrow keys when the area is focused.
  • Hide the real pointer inside the lens only if the lens is large.

Code

HTML
<div class="bx"><div class="sc" id="sc" tabindex="0" aria-label="Content area. Move the pointer or use arrow keys to move the lens"><div class="in" id="in"><b>Tiny details</b><p>Fine print, hairlines and small icons are easy to miss at normal size.</p><div class="dots"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div></div><div class="ls" id="ls"><div class="cl" id="cl"></div></div></div><label class="rw">Zoom <b id="zv">2.5x</b><input id="zm" type="range" min="15" max="40" value="25"></label></div>

Related patterns

Frosted Glass & Acrylic

↗
Frosted Glass & AcrylicSurfaces & Objects

Lens Distortion Grid

↗
Lens Distortion GridLens & Shot Size

Condensation Droplets

↗
Condensation DropletsGlass & Tactile