X-ray Lens Cursor

A round lens follows the pointer on a spring and shows a second, perfectly aligned layer of the same content — blueprint, wireframe or annotations — through a clip-path. Press to swell the lens. The reveal is decorative and hidden from assistive tech.

Try it: Move over the poster to open the lens; press and hold to swell it.

Installation

Install with the shadcn CLI:

npx shadcn@latest add https://www.framekitui.live/r/xray-lens-cursor.json

Or, with the @framekit namespace registered: npx shadcn@latest add @framekit/xray-lens-cursor. You can also copy the source into components/ui/xray-lens-cursor.tsx (view on GitHub).

Usage

import { XrayLensCursor } from '@/components/ui/xray-lens-cursor'

Props

Component props
PropTypeDefaultNotes
childrenReactNode—The normal layer everyone reads.
revealReactNode—The aligned layer shown inside the lens (decorative duplicate of the same layout).
size / pressedSizenumber170 / 250Lens diameter in px, resting and while pressed.
labelstring'x-ray'Caption on the lens rim (shows live coordinates).
classNamestring—Extra classes merged onto the frame.

Dependencies

  • motion

See all 8 Cursors components