Make your AI a shadcn expert

Magnify Text

Cursor-driven magnifying glass that scales a circular region of text in place with a glass rim and spring-smoothed motion for React, Next.js, and motion.

Magnify Text preview

Scroll to load preview

A real magnifying glass that follows your cursor across the headline — the region inside the lens renders the same text scaled up by 1.5x (configurable), so glyphs grow as the loupe passes over them and shrink back as it leaves. Two perfectly aligned text layers do the work: a base layer at normal size, and a duplicate layer scaled up and clipped to a circular clip-path bound to the cursor. A subtle 1px rim ring around the clip sells the glass-edge illusion. Cursor position is tracked via useMotionValue and routed through useSpring (stiffness 280) so the lens glides like a heavy physical object, never snapping. Configure the lens diameter, the magnification factor, and the rim color. Perfect for product page headlines, demo sections, easter eggs in landing copy, or anywhere a hero word deserves to be inspected up close.

Install with AI

If you've connected the shadcn.io MCP server to Claude Code, Cursor, Windsurf, or any MCP-ready AI editor, prompt your agent to install this text effect for you — no copy-paste, no CLI:

use shadcnio to install the magnify-text text effect into my project

FAQ

Was this page helpful?

Sign in to leave feedback.