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

spotlight-card

v1.0.1

Published

Animated spotlight card component for React — mouse-tracking radial gradient effect

Readme

Spotlight Card — React Mouse-Tracking Hover Glow Component

npm version npm downloads CI TypeScript license

A React component that adds a mouse-tracking radial glow effect to any card. One import, zero dependencies, works with Tailwind CSS or inline styles.

<SpotlightCard className="p-8 rounded-xl bg-zinc-900 border border-zinc-800">
  <h3>Hover me</h3>
  <p>The spotlight follows your cursor.</p>
</SpotlightCard>

spotlight-card demo — mouse-tracking radial glow effect on a React card component

Install

npm install spotlight-card

Usage

Component

import { SpotlightCard } from "spotlight-card";

function App() {
  return (
    <SpotlightCard
      style={{
        padding: "2rem",
        borderRadius: "12px",
        background: "#1e1e2e",
        border: "1px solid #313244",
      }}
    >
      <h3>Hover me</h3>
      <p>The spotlight follows your cursor.</p>
    </SpotlightCard>
  );
}

With Tailwind CSS

<SpotlightCard className="p-8 rounded-xl bg-zinc-900 border border-zinc-800">
  <h3 className="text-lg font-bold">Feature</h3>
  <p className="text-zinc-400">Description of the feature.</p>
</SpotlightCard>

Custom Colors

<SpotlightCard color="59, 130, 246" opacity={0.2} size={400}>
  Blue spotlight with larger radius
</SpotlightCard>

Hook Only

Use useSpotlight for full control over rendering:

import { useSpotlight } from "spotlight-card";

function CustomCard() {
  const { containerRef, spotlightStyle, handlers } = useSpotlight({
    size: 300,
    color: "168, 85, 247",
    opacity: 0.15,
  });

  return (
    <div ref={containerRef} {...handlers} style={{ position: "relative" }}>
      <div style={spotlightStyle} />
      <p>Custom layout with spotlight</p>
    </div>
  );
}

API

<SpotlightCard>

| Prop | Type | Default | Description | | --------- | ------------- | ----------------- | ----------------------------- | | size | number | 350 | Spotlight radius in pixels | | color | string | "255, 255, 255" | RGB color string | | opacity | number | 0.15 | Spotlight opacity (0-1) | | enabled | boolean | true | Enable/disable the effect | | as | ElementType | "div" | Render as a different element |

Plus all standard HTML div attributes (className, style, onClick, etc.).

useSpotlight(options?)

Returns { containerRef, spotlightStyle, handlers, state }.

  • containerRef — attach to the container element
  • spotlightStyle — CSS for the spotlight overlay
  • handlers{ onMouseMove, onMouseEnter, onMouseLeave }
  • state{ x, y, isHovered }

Author

Ofer Shapira

LinkedIn GitHub

License

MIT