Lens
Lens magnifies a region of its children and exposes size, position and zoom controls.
Practical React example
Let someone inspect a small visual detail while keeping the original image understandable.
Before you copy and paste
Match the imported component’s client or server rendering boundary before using the example. Copy components/magicui/lens.tsx and its returned support files from the Code tab; preserve the project-relative paths.
Listed package dependencies: motion.
Use the Code tab for the component files and installation instructions, then adapt the imports in this example to your project.
Let someone inspect a small visual detail while keeping the original image understandable
// Usage adapted from Magic UI's pinned MIT source.
// Copyright (c) Magic UI. See ./LICENSES.md.
'use client';
import { Lens } from "@/components/magicui/lens"
export function ComponentExample() {
return (
<Lens>
<img src="/images/lens-demo.jpg" alt="Lens Demo" />
</Lens>
);
}
Usage example adapted from Magic UI's pinned MIT source. Retain the source licence notices when copying.
Supply a descriptive image and a stable container size. Start with a modest zoomFactor and verify how the lens stays within the visual bounds.
Customization
- LensProps.children
- Required; React.ReactNode. The children of the lens
- LensProps.zoomFactor
- Optional; number. The zoom factor of the lens
- LensProps.lensSize
- Optional; number. The size of the lens
- LensProps.position
- Optional; Position. The position of the lens
- LensProps.defaultPosition
- Optional; Position. The default position of the lens
- LensProps.isStatic
- Optional; boolean. Whether the lens is static
- LensProps.duration
- Optional; number. The duration of the animation
- LensProps.lensColor
- Optional; string. The color of the lens
- LensProps.ariaLabel
- Optional; string. The aria label of the lens
Integration notes
- The lens should supplement a normal full-resolution viewing path.
- Test keyboard and touch access to the same detail rather than relying on pointer movement alone.
Component source: Magic UI documentation . These examples describe the version imported into Rendyn. Upstream APIs may have changed; retain the source licence notices when adapting the code.
Give your agent taste.
The best way to use Rendyn is through MCP. Let your agent find the right component, compare previews and bring the source into your project.
All components are free. Sign up only to connect MCP.