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

@outpacelabs/avatars

v0.2.1

Published

React component for deterministic mesh-gradient avatars — a unique gradient for every seed, no stored images.

Readme


Give it any string or number — a user id, an email, a username — and it paints a unique, good-looking gradient on a <canvas>. The same seed always yields the same gradient, so you get stable avatars with nothing to store and nothing to fetch. The gradient engine is bundled in, so this is the only thing you install.

Install

npm i @outpacelabs/avatars

react >= 18 is the only peer dependency. Works with React 18 and 19.

Usage

import { GradientAvatar } from "@outpacelabs/avatars";

function UserAvatar({ user }) {
  return <GradientAvatar seed={user.id} size={40} />;
}

That's the whole API surface for most apps. A few more:

<GradientAvatar seed="[email protected]" size={96} />            {/* circle (default) */}
<GradientAvatar seed="[email protected]" size={96} radius={16} /> {/* rounded square */}
<GradientAvatar seed="[email protected]" size={96} radius={0} />  {/* square */}
<GradientAvatar seed={42} size={64} className="ring-2 ring-white/10" />

Why @outpacelabs/avatars

  • Deterministic — same seed, same gradient, every time. A user id or email is the avatar; you never store or migrate an image.
  • No images, no network — rendered at runtime on a <canvas>. No CDN, no requests, no broken <img> links, no upload pipeline.
  • Tiny & zero-dependency — ~2.3 kB gzipped; react is the only peer.
  • Actually pretty — soft mesh gradients, not blocky identicons.
  • Any size, any shape — circles, rounded squares, squares — your call.
  • Exports anywhere — built-in helpers turn a seed into a data URL, a Blob, or a full-resolution image for downloads and clipboard.
  • Typed — ships with TypeScript declarations.

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | seed | string \| number | — | Any value; each unique seed is a unique gradient. | | size | number | 32 | Rendered size in pixels. | | radius | number \| string | "9999px" | Corner radius. Number = pixels, string = any CSS length. Defaults to a full circle; pass 0 for a square. | | className | string | — | Extra classes on the wrapper <span>. | | style | CSSProperties | — | Extra inline styles merged onto the wrapper. |

Beyond React: the engine

The framework-agnostic engine is re-exported, so you can generate gradients without rendering a component — handy for an <img src>, a download button, or a server-rendered preview.

import { gradientToDataURL, generatePalette } from "@outpacelabs/avatars";

// A 512×512 PNG data URL — drop straight into an <img>.
const src = gradientToDataURL("[email protected]", { size: 512 });

// Just the colors behind a seed.
const { colors, harmony } = generatePalette("[email protected]");

| Helper | Description | |--------|-------------| | drawMeshGradient(ctx, seed, size) | Paint the raw mesh into a 2D canvas context. | | renderGradient(canvas, seed, options?) | Render a seed into a canvas with the signature soft blur. | | gradientToDataURL(seed, options?) | Render and return a data URL. | | gradientToBlob(seed, options?) | Render and resolve a Blob (e.g. for the clipboard). | | generatePalette(seed) | The colors and harmony rule behind a seed. | | seedFromString(input) / toSeed(seed) | The deterministic hashing that turns any value into a numeric seed. |

Types GradientPalette, Harmony, RenderOptions, and ExportOptions are exported too.

Playground

Type any seed and watch the gradient at avatars.outpacestudios.com — copy it to your clipboard or download a 2000×2000 image. Full docs at /docs.

License

MIT — free to use. By Outpace Studios.