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

thread-ui

v0.13.1

Published

UI Library for React Applications.

Readme

Thread UI

Thread is a React component library I built to create my personal website. It's designed around a clean, token-based theme system with easy customization, light/dark mode and SSR support.

Get Started

All items work out of the box. Explore thread components at thread.fisherandrew.org!

Setup

npm install thread-ui

Then import the styles once in your app's entry point:

import 'thread-ui/thread.css';
  • Next.js (App Router): place in app/layout.tsx
  • Next.js (Pages Router): place in pages/_app.tsx
  • Vite / CRA: place in main.tsx or index.tsx
  • Remix: import in root.tsx

Design System

Thread UI is built around a central Theme that defines token values across the library - colors, spacing, type scales. Thread's design language governs how these tokens are applied to communicate hierarchy and intent.

Surface Layers

Thread UI uses a layer-based elevation system. Every component either sits on a named layer (canvas, inset, surface, elevated, overlay) or opts out entirely (transparent). The layer determines the component's background color, shadow depth, border treatment, and stacking order.

| Layer | Purpose | | ---------- | --------------------------------------------------------------------------- | | canvas | Page background. The base everything sits on. | | inset | Recessed containers: inputs, code blocks, wells. Visually below the canvas. | | surface | Cards, panels, content regions. Pops against canvas. | | elevated | Sticky nav, toolbars. Differentiated by shadow in light mode. | | overlay | Modals, popovers. Highest elevation. |

// Components resolve their bg, shadow, and border from the layer
<Card layer="surface" />

// Individual overrides when needed
<Card layer="surface" bg="elevated" shadow="md" structure="none" />

The Two Rules

  1. Light mode communicates elevation through shadows. Surface, elevated, and overlay share the same background color — shadows and z-index differentiate them.
  2. Dark mode communicates elevation through lightness. Each layer step up is slightly lighter. Shadows are nearly invisible against dark surfaces.

Typography

Thread's typography system is built on roles — semantic chords that combine font family, size, weight, line height, letter spacing, and bottom margin into named presets like title, h1h3, body, and code. Each role is defined once in the theme and consumed by components (<Title>, <H1>, <Text>, <Code>, etc.) so visual hierarchy stays consistent across the app.

Individual tokens (font sizes, weights, line heights, etc.) can be overridden per-instance for fine control, or theme-wide via ThemeProvider. Spacing flows through a shared scale (nonexxl) so heading and paragraph rhythm follows the same vocabulary as the rest of the system.

Features

Custom Themes

Thread supports custom themes that override the default design tokens, including when using SSR. Wrap your app in ThemeProvider and pass a partial ThemeConfig — customize as much or as little as you want.

const customTheme: ThemeConfig = {
	primary: {
		light: '#4f46e5',
		main: '#4338ca',
		dark: '#3730a3',
	},
};

return <ThemeProvider theme={customTheme}>{children}</ThemeProvider>;

Dark Mode

Thread includes built-in light/dark/system UI modes. Default UI behavior matches the system and works out of the box.

To override the default mode, utilize ThreadScript. This injects an inline script into your <head> that reads the configured default mode, or even the user's saved preference in localStorage and sets data-theme on :root before the first paint — eliminating any flash of wrong-mode content.

// Next.js App Router
<html suppressHydrationWarning>
	<head>
		<ThreadScript defaultMode="system" />
	</head>
	<body>
		<ThemeProvider>{children}</ThemeProvider>
	</body>
</html>

SSR Compatible

Component CSS is pre-generated using Panda CSS, so components render correctly server-side without any runtime style injection. Most components are SSR compatible, and all client-side components and hooks are marked with use client and work out of the box with Next.js.

Components

UI Elements

Button Card Divider DotsLoader Icon IconButton Modal SkeletonLayoutLoader SkeletonLoader SpinLoader Toggle

Media Display

ImagePanel InfoCard MediaCard

Content Display

Carousel Gallery Lightbox TabView

Typography Elements

Title H1 H2 H3 Text Subtitle List OrderedList PageHeader

Navigation Components

NavMenu SideNav

Form Elements

Dropdown FileUpload FormLabel NumberInput TextInput

Layout Components

Container ColumnLayout Footer MasonryLayout

Data Display

DataDisplayControls FilterControls SortControls

Hooks

useClickOutside useDismiss usePathname