Early accessFull site coming soon. Pro is $49.99 a year. See pricing ›

Nexus UI

Glass Lens, animated React component

A glass puck you drag over content. It magnifies the centre and splits colour toward the rim, built from three offset copies of the content instead of a shader.

  • Pro
  • Motion Effects
  • Spring

Play with it

Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.

Field notes

Glass is not a filter you lay on top. It is a material that bends whatever sits behind it.

Drag the lens across the page. The edges split light into colour, the centre magnifies.

Props

PropTypeDefaultWhat it does
size150Lens diameter in px.
zoom1.45Magnification at the centre of the lens.
width520Width of the content surface in px.
height300Height of the content surface in px.
childrenField notes textContent under the glass. It is rendered four times (page plus three lens layers), so keep it static.
autoplayfalseDrifts across the content by itself until the user drags it.