Skip to content

Cursor Magnifier

Pro

A glass lens follows the pointer over one section and magnifies what is under it. It stretches with the move and wobbles when it stops.

  • Base UI
  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 18, 2026 · Pro license

Playground

Loading the preview

Props

Needs your Pro API key in GELATIN_UI_PRO_TOKEN. Set it up

Pro itemAPI key required

Cursor Magnifier needs a Pro API key

Try the live preview for free. With Pro, the add command above puts the source in your project.

Files it adds
23
More Pro items, one API key
+327
Your coding agent runs it
1 cmd

$79$129once, for life

Already have Pro? Sign in to set up your API key.

Put the content and the lens inside the root. The lens magnifies a copy of the content.

The sample also uses Image. One command adds them with this item:

product-detail.tsx

CursorMagnifier

<section>
PropTypeDefaultDescription
pausedbooleanfalseTrue keeps the lens where it is and stops the follow, the keys, and the finger. Default false.
...props<section> attributes—Every other attribute goes to the <section>, with a ref.

CursorMagnifierContent

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

CursorMagnifierLens

<div>
PropTypeDefaultDescription
diameternumber168The width and height of the lens, in px, 24 or more. Default 168.
zoomnumber1.75How much the lens magnifies, from 1 to 8. Default 1.75.
wobblenumber1How much the lens stretches and wobbles, from 0 (a rigid lens) to 1.5. Default 1.
refractionnumber1How much the rim bends the picture, from 0 (flat) to 1.5. Default 1.
childrenReactNode—A sharper copy for the lens, at the size of the Content (a 2× photo). Without children the lens shows a copy of the Content.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Put the picture or text in CursorMagnifierContent, and place CursorMagnifierLens after it.
  • Pass a 2× Image as the children of the lens for a sharp zoom.
  • Give the root tabIndex={0} and an aria-label, so the keyboard can show and move the lens.
  • Set --cursor-magnifier-fill on the root when the surface is not the page background.
  • For a full view of a photo that people open and close, use a Lightbox.
  • For a plain picture with a loading and an error state, use Image.
TabMoves to the root when it has tabIndex={0} and shows the lens in the middle. A focused control in the Content pulls the lens to it.
Arrow keysMove the lens 24 px while the root has focus.
ShiftArrow keysMove the lens 96 px while the root has focus.
EscapeHides the lens.

The root is a section. Give it an aria-label when it takes keyboard focus.

The lens is aria-hidden, and its copy of the Content is inert, so screen readers and Tab reach the content only once.

On touch, press and drag: the lens sits above the finger, and a vertical swipe still scrolls the page.

Follow
follow · spring of 0.45s with a soft bounce, so the lens lags and settles
Stretch and wobble
follow · spring of 0.5s with a strong bounce, up to 1.22× along the move
Show and hide
follow · spring of 0.35s, the lens grows from 60% and fades
Stretch turn
follow · spring of 0.2s with no bounce, so a new direction does not swing past
  1. AddedCursor Magnifier.
Open the release