# Glass Lens

> A disc of liquid glass that glides after the cursor, enlarging whatever is beneath it, with a rainbow rim and a highlight rolling across the dome.

Category: Cards · MotionKit Plus · Updated 2026-11-09 · Live demo: https://www.motionkitui.com/components/glass-lens

## When to use it

Photography and product heroes, art and illustration portfolios, detailed maps or diagrams, and headlines that want a playful, tactile moment.

## How it works

Your content renders once as normal, then a second, inert copy sits inside a round clipping disc and is scaled up by the zoom. As the lens moves, the copy is shifted by the lens position times the zoom, so the point under the centre of the lens stays exactly in place while everything around it is enlarged. Springs give the glide its weight. The glass is layered on top: inset shadows for thickness, a conic rainbow masked to a thin ring for the rim and a radial highlight that slides the opposite way to the lens, as light does on a dome.

## Installation

Part of MotionKit Plus (https://www.motionkitui.com/pricing). Subscribers install it with `npx shadcn@latest add @motionkit/glass-lens` after adding their registry token from https://www.motionkitui.com/account.

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` |  | What sits under the glass: an image, a headline or a whole card. |
| `zoom` | `number` | `1.8` | How much the lens enlarges. |
| `size` | `number` | `150` | Lens diameter in pixels. |
| `dispersion` | `number` | `0.7` | Strength of the rainbow rim, 0 to 1. |
| `idle` | `boolean` | `true` | Drift slowly over the content while no pointer is on it. |

## Accessibility

- **Keyboard: Not applicable.** A visual effect over your content; anything focusable inside works as normal.
- **Screen readers: Pass.** The lens and its enlarged copy are hidden and inert, so your content is read once and never focused twice.
- **Reduced motion: Pass.** With reduced motion on, the lens doesn't drift by itself and follows the pointer without easing.
- **Colour contrast: Not applicable.** Your content keeps its own contrast; the lens only enlarges it.
