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>| Prop | Type | Default | Description |
|---|---|---|---|
| paused | boolean | false | True 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>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
CursorMagnifierLens
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| diameter | number | 168 | The width and height of the lens, in px, 24 or more. Default 168. |
| zoom | number | 1.75 | How much the lens magnifies, from 1 to 8. Default 1.75. |
| wobble | number | 1 | How much the lens stretches and wobbles, from 0 (a rigid lens) to 1.5. Default 1. |
| refraction | number | 1 | How much the rim bends the picture, from 0 (flat) to 1.5. Default 1. |
| children | ReactNode | — | 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. |
| Tab | Moves 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 keys | Move the lens 24 px while the root has focus. |
| ShiftArrow keys | Move the lens 96 px while the root has focus. |
| Escape | Hides the lens. |









