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

@patternmode/parquet

v0.1.8

Published

A proportional color mosaic that re-tiles and morphs as a palette's weights change.

Readme

@patternmode/parquet

A proportional color mosaic. Each tile's area encodes its weight, and the layout re-tiles and morphs when the palette changes — the two-dimensional, read-only counterpart to Swatch's DistributionBar.

import { Parquet } from "@patternmode/parquet";
import "@patternmode/parquet/styles.css";

const palette = [
  { color: "#c2703e", value: 0.42, label: "Terracotta" },
  { color: "#2d5a27", value: 0.28, label: "Forest" },
  { color: "#1b2a4a", value: 0.18, label: "Navy" },
  { color: "#e8b4b8", value: 0.12, label: "Blush" },
];

export function Example() {
  return <Parquet colors={palette} showLabels />;
}

Parquet is controlled: it renders one distribution and morphs (a CSS transition on the tiles' geometry) whenever colors changes. Rotation, in-view gating, and surrounding stats are the consumer's responsibility — pass a new colors array to animate to a new palette.

Tiles and slots

Tiles are assigned to slots by descending area, so the largest weight always occupies slot 0. When the palette changes, slot 0 morphs from the old biggest tile to the new biggest tile instead of teleporting. Set slotCount to keep a fixed number of slots when morphing between palettes of different lengths — extra slots collapse to nothing.

Input

colors is an array of ParquetTile, which extends the shared WeightedColorSegment ({ color, value, label? }) from @patternmode/system. The same array can drive a DistributionBar and a Parquet. value is a relative weight, not a persisted percentage; zero, negative, and invalid weights render no tile.

Labels

With showLabels, each tile shows its label and derived percentage on hover, with a foreground color chosen for contrast (via @patternmode/system's isLightColor, which resolves perceptual lightness). Pass renderTile(tile, { percent, isLight, slot, width, height }) to replace the label content entirely.

Props

| Prop | Type | Default | Description | | --------------- | --------------------------- | --------------- | -------------------------------------------- | | colors | ParquetTile[] | — | Weighted colors to pack. | | aspectRatio | number | 4 / 3 | Mosaic width ÷ height. | | gap | number | 10 | Gap between tiles, in internal layout units. | | slotCount | number | colors.length | Fixed slot count for stable morphs. | | showLabels | boolean | false | Show built-in hover labels. | | renderTile | (tile, meta) => ReactNode | — | Custom tile content. | | disableMotion | boolean | false | Disable enter/morph animation. |

The pure packSquarified algorithm is also exported for custom renderers.