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

bonework

v0.3.2

Published

Minimal-effort skeleton loaders for React — wrap what you already render, and CSS Anchor Positioning keeps shimmers aligned to the real DOM. No sizing props, no skeleton stand-ins, no drift as your UI evolves.

Readme

❝Ossa loquuntur, dum carnem expectamus.❞ The bones speak while we wait for the flesh.

Checks

Minimal-effort skeleton loaders for React — wrap what you already render, and CSS Anchor Positioning keeps shimmers aligned to the real DOM. No sizing props, no skeleton stand-ins, no drift as your UI evolves.

View Live Demo →

Contents

  1. Getting started
  2. Palette
  3. Placeholder
  4. Depth
  5. Recipes

For advanced topics, see the recipes directory.

Getting started

Install, wrap what you already render, and flip skeleton while data is loading. useBonework() inside lets descendants render safe fallbacks that vanish when real data lands:

pnpm add bonework
import { Bonework, useBonework } from "bonework";

const aed = new Intl.NumberFormat("en-AE", {
  style: "currency",
  currency: "AED",
});

type BalanceProps = { amount: number | null };
type WalletProps = { data: Wallet | null };

function Balance({ amount }: BalanceProps) {
  const bonework = useBonework();
  const formatted = amount != null ? aed.format(amount) : null;
  return <span>{bonework.placeholder(formatted, aed.format(0))}</span>;
}

export function Wallet({ data }: WalletProps) {
  return (
    <Bonework skeleton={!data}>
      <h1>{data?.name ?? "Placeholder name"}</h1>
      <Balance amount={data?.balance ?? null} />
    </Bonework>
  );
}

Two moving parts. <Bonework> wraps the real UI in a display: contents host, walks the rendered DOM in a useLayoutEffect, and paints shimmers over each target via CSS Anchor Positioning while skeleton is true. useBonework() reads that state so descendants render fallbacks (placeholder(actual, fallback)) that vanish once the skeleton drops.

Because Bonework operates on the real DOM — not on React elements — you don't need your children to forward ref/style/className. Wrap anything: native tags, third-party UI kits, portals. If it lands in the DOM, Bonework can anchor to it.

Palette

Bonework ships a neutral default ({ bone: "#e5e7eb", highlight: "#f3f4f6" }), so you can drop it in without wiring anything. Pass palette to align the shimmer with your design tokens — bone is the still band, highlight is the sweep:

<Bonework
  skeleton
  palette={{
    bone: theme.colour.surface.muted,
    highlight: theme.colour.surface.bold,
  }}
>
  ...
</Bonework>

The default is exported as defaultPalette if you want to spread over it.

Placeholder

useBonework() returns { skeleton, placeholder }. placeholder(actual, fallback) handles the common trap where a hard-coded default (data.balance ?? 0) leaks past resolution:

| actual | skeleton | Returns | | -------------------- | ---------- | ---------- | | present | either | actual | | null / undefined | true | fallback | | null / undefined | false | null |

Outside a <Bonework> the hook is still safe: placeholder just returns actual ?? null.

Depth

By default a single shimmer paints over each direct DOM child. For composed layouts — a row, a card — you usually want each leaf shimmering separately while wrapper gaps stay intact. Increase depth:

<Bonework skeleton palette={tokens} depth={2}>
  <div className="row">
    <img src="..." />
    <div>
      <strong>Name</strong>
      <p>Subline</p>
    </div>
  </div>
</Bonework>

depth={1} anchors the row. depth={2} anchors <img> and the inner <div>. Bump it further to descend deeper. Depth walks the rendered DOM, not the React element tree — so it works uniformly with plain tags, styled-components, third-party UI kits, and anything that ends up as real HTML.

Recipes

  • Tuningradius, duration, palette wiring.
  • Testing — asserting on anchored elements and testing the hook.
  • Browsers — support matrix and progressive-enhancement notes.
  • API — full type reference.