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

@don.sirivat/react-dots

v1.0.0

Published

Context-aware, image-sampling geometric dot matrix for React

Readme

react-dots

A context-aware, image-sampling geometric matrix for React. Renders an image as a grid of dots by sampling pixel data on an off-screen canvas, with a staggered wave animation. Degrades to a matte monochrome grid on load failure or CORS.

Install

npm install react-dots

Usage

import { Dots } from 'react-dots';

<Dots
  src="https://example.com/image.jpg"
  gridSize={20}
  width={400}
  height={400}
  dotRadius={3}
  duration={1200}
  crossOrigin="anonymous"
/>

Image sampling

  • src — Image URL. If missing, invalid, or CORS-blocked, the component falls back to a stark monochrome dot grid.
  • gridSize — Number of sampling steps per axis (e.g. 16 → 16×16 grid). Higher values = more detail and more dots.
  • crossOrigin — Set to "anonymous" (or "use-credentials") when the image is from another origin so the canvas is not tainted and pixel sampling works.

Layout and animation

  • width / height — Component size in pixels.
  • dotRadius — Radius of each dot in pixels.
  • duration — Full animation cycle duration in ms.
  • easing — CSS easing (default: cubic-bezier(0.4, 0, 0.2, 1)).

Styling

  • className — Applied to the wrapper div.
  • style — Inline styles for the wrapper.

API summary

| Prop | Type | Default | Description | |-------------|--------|---------|--------------------------------------| | src | string | null | null | Image URL to sample | | gridSize | number | 16 | Grid density (dots per row/column) | | width | number | 320 | Component width (px) | | height | number | 320 | Component height (px) | | dotRadius | number | 3 | Dot radius (px) | | duration | number | 1200 | Animation cycle (ms) | | easing | string | cubic-bezier(…) | Animation easing | | crossOrigin | string | "anonymous" | Image CORS mode |

Build and publish

# Install dependencies
npm install

# Build the library (output in dist/)
npm run build

# Publish to npm (ensure you're logged in: npm login)
npm publish

For scoped packages (e.g. @your-org/react-dots), use:

npm publish --access public

License

MIT