Loupe
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/button-loupeAbout this component
A magnifying glass follows the cursor across the button at 2.5x, rendered from a clone of the content shifted by CSS so the point under the cursor sits in the middle of the lens. The fine print under the label is only readable through it.
Triggers
- Hover
- Mouse tracking
- Spotlight
Techniques
- Mouse tracking
- CSS variables
- Transform only
- Event position
Difficulty
Intermediate
Accessibility
Keyboard and screen readers
The lens copy is aria-hidden; the real content (label and fine print) stays in the button for screen readers. The cursor is hidden only on hover-capable pointers while the lens is live.
Use it in anything you build, commercial and client work included. Licence