npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nextmag

v1.0.0

Published

NextMagnifierJS - A beautiful, customizable magnifying glass component for Next.js applications

Readme

NextMagnifierJS

A beautiful, customizable magnifying glass component for Next.js applications that provides an elegant way to zoom in on any part of your webpage.

NextMagnifierJS Demo

The control panel features a draggable interface with hover-activated submenus for adjusting radius, zoom level, ring color, and theme settings - all designed to stay out of your way while providing powerful customization options!

NextMagnifierJS Light Theme

🚀 Quick Start

npm install nextmag
# or
yarn add nextmag
# or
pnpm add nextmag

✨ Features

🎨 Slim Vertical Design - Modern, polished UI with smooth animations
🔧 Fully Customizable - Adjust size, zoom level, and ring color
🌙 Theme Flexible - Works with any theme system or standalone
📱 Responsive - Perfect on all screen sizes
🎯 Smart Positioning - Automatically avoids control panel overlap
Performance Optimized - Efficient rendering and memory management
🔧 TypeScript Ready - Full TypeScript support with exported types
🎮 Easy Integration - Drop-in component with minimal setup

📖 Basic Usage

'use client';

import React, { useState } from 'react';
import { MagnifyingGlass, ControlPanel } from 'nextmag';

export default function MyPage() {
  const [isActive, setIsActive] = useState(false);
  const [radius, setRadius] = useState(100);
  const [zoomLevel, setZoomLevel] = useState(2);
  const [ringColor, setRingColor] = useState('#3b82f6');
  const [controlPanelBounds, setControlPanelBounds] = useState();

  return (
    <div>
      {/* Your page content */}
      <h1>My Amazing Content</h1>
      <p>Hover over this text with the magnifying glass active!</p>

      {/* NextMagnifierJS Components */}
      {isActive && (
        <MagnifyingGlass 
          radius={radius}
          zoomLevel={zoomLevel}
          ringColor={ringColor}
          controlPanelBounds={controlPanelBounds}
        />
      )}

      <ControlPanel
        isActive={isActive}
        onToggle={() => setIsActive(!isActive)}
        radius={radius}
        onRadiusChange={setRadius}
        zoomLevel={zoomLevel}
        onZoomChange={setZoomLevel}
        ringColor={ringColor}
        onRingColorChange={setRingColor}
        onBoundsChange={setControlPanelBounds}
      />
    </div>
  );
}

🎨 With Theme Integration

If your app uses a theme system (like next-themes), you can integrate it:

'use client';

import { useTheme } from 'next-themes';
import { MagnifyingGlass, ControlPanel } from 'nextmag';

export default function MyPage() {
  const { theme, setTheme } = useTheme();
  // ... other state

  const handleThemeToggle = () => {
    setTheme(theme === 'dark' ? 'light' : 'dark');
  };

  return (
    <div>
      {/* Your content */}
      
      <ControlPanel
        // ... other props
        currentTheme={theme as 'light' | 'dark'}
        onThemeToggle={handleThemeToggle}
      />
    </div>
  );
}

🔧 API Reference

MagnifyingGlass Props

| Prop | Type | Required | Description | |------|------|----------|-------------| | radius | number | ✅ | Size of the magnifying glass (50-200px) | | zoomLevel | number | ✅ | Magnification level (1.5-5x) | | ringColor | string | ✅ | Color of the magnifying glass ring | | controlPanelBounds | object | ❌ | Bounds to avoid overlapping with control panel |

ControlPanel Props

| Prop | Type | Required | Description | |------|------|----------|-------------| | isActive | boolean | ✅ | Whether the magnifying glass is active | | onToggle | () => void | ✅ | Callback when toggle button is clicked | | radius | number | ✅ | Current radius value | | onRadiusChange | (value: number) => void | ✅ | Callback when radius changes | | zoomLevel | number | ✅ | Current zoom level | | onZoomChange | (value: number) => void | ✅ | Callback when zoom changes | | ringColor | string | ✅ | Current ring color | | onRingColorChange | (color: string) => void | ✅ | Callback when color changes | | onBoundsChange | (bounds: object) => void | ❌ | Callback when panel bounds change | | initialModalPosition | 'top-right' \| 'near-button' | ❌ | Initial position of control panel | | currentTheme | 'light' \| 'dark' | ❌ | Current theme (for theme integration) | | onThemeToggle | () => void | ❌ | Theme toggle callback (shows theme button) |

🎯 Integration Examples

Standalone (No Theme System)

// Just use the basic setup - no theme props needed
<ControlPanel
  isActive={isActive}
  onToggle={() => setIsActive(!isActive)}
  // ... other required props
/>

With Existing Theme System

// Pass your theme state and toggle function
<ControlPanel
  // ... required props
  currentTheme={yourTheme}
  onThemeToggle={yourThemeToggleFunction}
/>

Custom Positioning

<ControlPanel
  // ... other props
  initialModalPosition="top-right" // or "near-button"
/>

🎨 Styling Requirements

NextMagnifierJS requires Tailwind CSS to be configured in your project. Make sure you have:

  1. Tailwind CSS installed and configured
  2. The necessary Tailwind classes available in your build
npm install tailwindcss

🌟 Advanced Usage

Custom Color Palette

// The component includes these default colors:
// Blue, Red, Green, Yellow, Purple, Cyan, Orange, Gray
// You can set any hex color as the ring color
<ControlPanel
  ringColor="#ff6b6b" // Custom color
  onRingColorChange={setRingColor}
  // ... other props
/>

Performance Tips

// Only render MagnifyingGlass when active for better performance
{isActive && (
  <MagnifyingGlass 
    radius={radius}
    zoomLevel={zoomLevel}
    ringColor={ringColor}
    controlPanelBounds={controlPanelBounds}
  />
)}

🔧 TypeScript Support

NextMagnifierJS is built with TypeScript and exports all necessary types:

import { 
  MagnifyingGlass, 
  ControlPanel, 
  MagnifyingGlassProps, 
  ControlPanelProps 
} from 'nextmag';

🌐 Browser Support

  • Chrome/Edge 88+
  • Firefox 87+
  • Safari 14+

🐛 Issues & Contributing

This is a solo-maintained project. While I don't actively monitor issues daily, I do check periodically and will address bugs when possible.

Contributors welcome! If you'd like to help maintain this project:

  • 🍴 Fork the repo and submit PRs for bug fixes or features
  • 💬 Help answer questions in issues
  • 📖 Improve documentation
  • 🧪 Add tests or examples

For urgent issues, consider forking and implementing fixes yourself - PRs are always appreciated! 🙏

Reporting Issues

When reporting bugs, please include:

  • Next.js version
  • Browser and version
  • Steps to reproduce
  • Expected vs actual behavior

📝 Requirements

  • Next.js 13+
  • React 18+
  • Tailwind CSS 3+

🤝 Contributing

This project follows standard open-source contribution practices. Feel free to:

  • Open issues for bugs or feature requests
  • Submit pull requests with improvements
  • Help with documentation

Note: As a solo developer, response times may vary, but all contributions are valued and will be reviewed when possible.

📄 License

MIT © NextMagnifierJS - savevsgames

🔗 Links