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

ditherface

v0.2.3

Published

Tiny dependency-free React canvas dither component.

Readme

ditherface

Tiny, dependency-free React dither components.

  • No runtime dependencies (React is a peer dependency)
  • Keyboard + screen-reader accessible defaults
  • Respects prefers-reduced-motion

Install

npm i ditherface

Usage

import DitherFace from "ditherface";

export function DemoFace() {
  return (
    <DitherFace
      seed="ada-lovelace"
      className="h-72 w-72"
      animated
      dotScale={3}
    />
  );
}
import { Dither, DitherBackground } from "ditherface";

export function DemoBackground() {
  return (
    <DitherBackground
      className="h-72 w-full"
      animated
      dotScale={3}
      seed="marketing-hero"
      palette={["#3b82f6", "var(--brand-accent)", "--color-red-9"]}
    >
      <div style={{ position: "relative", zIndex: 1 }}>Content on top</div>
    </DitherBackground>
  );
}

export function DemoCanvas() {
  return <Dither className="h-56 w-full" pixelSize={2} colorNum={5} />;
}

Accessibility

  • Dither defaults to role="img" with an accessible label.
  • Keyboard controls when interaction is enabled: arrow keys move focus, Home resets.
  • Use decorative for purely visual usage.

Dither Props

  • seed?: string (default "ditherface")
  • tones?: string | string[] (explicit CSS tone steps)
  • palette?: string | string[] (select one deterministic base color from list)
  • palette and tones accept CSS color values, CSS custom properties like --brand-accent, and var(--brand-accent, #3b82f6) fallbacks
  • waveSpeed?: number (default 0.05)
  • waveFrequency?: number (default 3)
  • waveAmplitude?: number (default 0.3)
  • waveColor?: [number, number, number] (default [0.5, 0.5, 0.5])
  • colorNum?: number (default 4)
  • pixelSize?: number (default 2)
  • disableAnimation?: boolean (default false)
  • enableMouseInteraction?: boolean (default true)
  • mouseRadius?: number (default 1)
  • decorative?: boolean (default false)
  • ariaLabel?: string

DitherBackground Props

  • animated?: boolean (default true)
  • dotScale?: number (default 2)
  • seed?: string (default "ditherface")
  • tones?: string | string[]
  • palette?: string | string[]
  • children?: ReactNode
  • ditherProps?: Omit<DitherFaceProps, ...> for extra face-renderer options

DitherBackground uses the same renderer as DitherFace (without face features), so both components match visually.

All standard <canvas> or <div> props are forwarded on each component.

DitherFace Props

  • seed: string (required)
  • animated?: boolean (default true)
  • dotScale?: number
  • tones?: string | string[]
  • palette?: string | string[]
  • ariaLabel?: string
  • showFeatures?: boolean (default true)
  • showEyes?: boolean (default true)
  • compact?: boolean (default false)
  • children?: ReactNode (optional overlay)

DitherFace is the package default export.