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

workspace-avatars

v0.1.3

Published

Deterministic, theme-aware avatars with cross-stitch patterns. Pure CSS variable theming, no JS dark-mode hooks.

Downloads

495

Readme

workspace-avatars

Deterministic, theme-aware avatars with cross-stitch patterns. Same seed → same pattern, every time. Light/dark via pure CSS variables — no useDarkMode hook, no MutationObserver, no re-renders on theme change.

npm i workspace-avatars

Usage

import { WorkspaceAvatar } from "workspace-avatars";

<WorkspaceAvatar seed="acme-corp" />
<WorkspaceAvatar seed="[email protected]" config={{ style: "initials", size: "lg" }} />
<WorkspaceAvatar seed="project-x" config={{ style: "block", containerRadius: 20 }} />

That's it! Styles are included automatically.

Dark mode

The component automatically switches palettes when a .dark class is present on any parent element. Just toggle the class and the avatars update via CSS variables - no re-renders, no JavaScript.

Customizing colors

The component uses 8 deterministic color palettes. To customize any palette, define CSS variables in your global stylesheet:

:root {
  /* Override palette 0 for light mode */
  --avatar-palette-0-bg: #f5f3f0;
  --avatar-palette-0-fg: #8b7d6b;
  --avatar-palette-0-mid: #b5a89a;
}

.dark {
  /* Override palette 0 for dark mode */
  --avatar-palette-0-bg: #1c1a17;
  --avatar-palette-0-fg: #a89b88;
  --avatar-palette-0-mid: #6b5f4f;
}

Palettes are numbered 0–7. Each palette has 3 colors:

  • bg — background fill
  • fg — primary pattern color
  • mid — secondary depth/shading color

The component automatically selects a palette by hashing the seed, but you can override any palette's colors via CSS variables. If not defined, the component uses hardcoded default colors.

Props

| Prop | Type | Default | Description | | ----------- | -------------------- | -------- | --------------------------------------------- | | seed | string | required | Any string — hash drives palette and pattern. | | config | PatternConfig | — | Override style, density, gap, padding, etc. | | className | string | — | Forwarded to outer wrapper. | | style | React.CSSProperties| — | Inline styles forwarded to outer wrapper. |

PatternConfig

| Field | Type | Default | Notes | | ----------------- | -------------------------------------------------------- | ----------- | ------------------------------------------------ | | style | "pixel" \| "block" \| "quilt" \| "initials" | "quilt" | Pattern type (8×8 / 10×10 / 9×9 grid or text). | | size | "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "2xl" \| "3xl" | undefined | 24px → 240px. Omit for fluid sizing. | | cellRadius | 0–100 | 15 | Cell corner radius (% of cell size). | | containerRadius | 0–100 | 0 | Avatar container border-radius (% of size). | | padding | 0–100 | 0 | Outer padding (% of avatar size). | | gap | 0–100 | 10 | Gap between stitches (% of cell). | | density | 0–100 | 56 | Pattern fill density. | | depth | 0–100 | 30 | Density of secondary mid-tone "depth" thread. | | border | boolean | false | Enable border around avatar. | | borderWidth | 1–10 | 1 | Border width in pixels. | | stitchShape | "rounded" \| "square" | "rounded" | Deprecated—use cellRadius instead (no effect). |

License

MIT