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

@puzzle-ui/theme

v0.12.0

Published

Design tokens, theme providers, and typography for Puzzle React applications

Readme

@puzzle-ui/theme

Design tokens, color themes, typography, fonts, and theme scoping for Puzzle.

Documentation: https://puzzle-ui.com/docs/theme

See the theme documentation for API maturity and compatibility details.

@puzzle-ui/theme is the source of truth for Puzzle's visual design. Its Theme provider turns a typed token object into CSS custom properties (--puzzle-*), loads configured fonts, resolves light, dark, and system color schemes, and can scope a theme to the whole document or a single subtree. All @puzzle-ui/ui components consume these variables, so a single provider styles your application.

Install

npm install @puzzle-ui/theme
# or
bun add @puzzle-ui/theme
# or
pnpm add @puzzle-ui/theme
# or
yarn add @puzzle-ui/theme

React and React DOM 19 are peer dependencies.

Usage

Wrap your application once at the root:

import { Theme } from "@puzzle-ui/theme";

export const App = () => (
  <Theme>
    <YourApp />
  </Theme>
);

Customize the color scheme, color theme, fonts, and tokens:

<Theme
  theme="system"
  colorTheme="cobalt-sky"
  fonts={{
    heading: { family: "Sora" },
    body: { family: "Inter" },
  }}
  tokens={{
    radius: { md: "0.5rem" },
  }}
>
  <YourApp />
</Theme>

Features

| Area | Description | Docs | | -------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | | Theme provider | Injects token CSS variables, loads fonts, and applies global styles at root or local scope. | Theme Provider | | Design tokens | Typed token groups for spacing, radius, shadows, elevation, borders, layout, motion, and z-index. | Design Tokens | | Colors | Semantic color roles, light/dark color schemes, and built-in color themes. | Colors | | Typography and fonts | Named typography roles, fluid font sizes, Google Fonts, and self-hosted fonts. | Typography and Fonts | | Breakpoints | Shared responsive breakpoints for JavaScript and CSS. | Breakpoints | | Component overrides | Global link and image components for router and framework integration. | Component Overrides |

Self-host fonts with the theme CLI

The @puzzle-ui/theme package includes the puzzle-theme executable. It requires Node.js 20.19 or later.

npm install @puzzle-ui/theme
npm exec -- puzzle-theme --help

Create puzzle-fonts.json in your application's working directory:

{
  "body": {
    "family": "Inter",
    "weights": [400, 700]
  }
}

Download the fonts with either package manager:

npm exec -- puzzle-theme fonts download
# Or, with the package installed using Bun:
bun run puzzle-theme fonts download

The command writes WOFF2 files and puzzle-fonts.css to public/fonts. Use --config <path> or --out-dir <path> to change these locations. Unchanged downloads are skipped; --force downloads them again.

For variable fonts, use "weightRange": [300, 700] instead of weights to request a continuous range. Only use ranges supported by the font family. Discrete weights remain supported; when both are provided, the range is used.

The downloader keeps all language subsets by default. Pass --subsets latin,latin-ext to retain only Latin and Latin Extended; missing requested subsets produce an error. Other scripts will use fallback fonts. Subset choices are included in the download cache key.

To load the generated stylesheet, set fontSource="local" on Theme and pass the same configuration to its fonts prop. The default local stylesheet URL is /fonts/puzzle-fonts.css.

When using local fonts, Puzzle automatically preloads the normal Latin variant of the body font. Use fontPreload="heading" or fontPreload="accent" to preload another configured role, or fontPreload={false} to disable preloading.

The generated stylesheet and preload link use the same font URL, avoiding duplicate downloads. Preloading only applies to local fonts and only one font is preloaded per Theme instance.

With a Nitro server, such as TanStack Start with nitro/vite, pass createFontRouteRules() from @puzzle-ui/theme/nitro to routeRules. Versioned font files are then cached for a year as immutable, and puzzle-fonts.css and preload fonts for a day with background revalidation:

import { nitro } from "nitro/vite";
import { createFontRouteRules } from "@puzzle-ui/theme/nitro";

nitro({ routeRules: createFontRouteRules() });

Related packages