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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@differential-studio/ui

v1.0.3

Published

A shared React component library for Differential tools

Readme

@differential-studio/ui

A shared React component library for Differential tools.

Installation

Install the package and its peer dependencies:

npm install @differential-studio/ui next-themes react react-dom

# Install peer dependencies for components you use
npm install @radix-ui/react-dialog @radix-ui/react-dropdown-menu
# ... and other @radix-ui packages as needed

Or install all common peer dependencies at once:

npm install @differential-studio/ui next-themes react react-dom \
  @radix-ui/react-accordion @radix-ui/react-alert-dialog \
  @radix-ui/react-dialog @radix-ui/react-dropdown-menu \
  @radix-ui/react-label @radix-ui/react-popover \
  @radix-ui/react-select @radix-ui/react-slot \
  @radix-ui/react-tabs @radix-ui/react-toast \
  @radix-ui/react-tooltip lucide-react clsx tailwind-merge

Setup

Wrap your app with ThemeProvider:

import { ThemeProvider } from "next-themes";
import "@differential-studio/ui/styles";

function App() {
  return (
    <ThemeProvider attribute="class" defaultTheme="system">
      {/* Your app */}
    </ThemeProvider>
  );
}

Components

DifferentialHeader

import { DifferentialHeader } from "@differential-studio/ui";

// Public mode (unauthenticated)
<DifferentialHeader
  toolName="Your Tool Name"
  showSignIn
  onSignIn={() => navigate("/auth")}
/>

// Authenticated mode
<DifferentialHeader
  toolName="Your Tool Name"
  user={{
    subscriptionTier: "pro",
    tokenBalance: 100,
    tokenLimit: 500,
    storageUsed: 1073741824,    // bytes
    storageLimit: 10737418240,  // bytes
  }}
  onSignOut={() => signOut()}
  onTokenClick={() => navigate("/pricing")}
/>

DifferentialFooter

import { DifferentialFooter } from "@differential-studio/ui";

<DifferentialFooter />

ThemeToggle

import { ThemeToggle } from "@differential-studio/ui";

<ThemeToggle />

Full Example

import { DifferentialHeader, DifferentialFooter } from "@differential-studio/ui";

function App() {
  return (
    <div className="min-h-screen bg-background flex flex-col">
      <DifferentialHeader toolName="My Tool" showSignIn />
      <main className="flex-1">{/* Content */}</main>
      <DifferentialFooter />
    </div>
  );
}

Building & Publishing

Development

npm install
npm run dev

Building

npm run build

This will create the dist folder with:

  • index.es.js - ES module build
  • index.umd.js - UMD build
  • lib-exports.d.ts - TypeScript definitions

Publishing to NPM

  1. Login to NPM (if not already):

    npm login
  2. Build the package:

    npm run build
  3. Publish (the prepublishOnly script will automatically build before publishing):

    npm publish --access public

    For scoped packages like @differential-studio/ui, you need the --access public flag unless you have a paid NPM account.

  4. Update version for subsequent releases:

    npm version patch  # for bug fixes (1.0.0 -> 1.0.1)
    npm version minor  # for new features (1.0.0 -> 1.1.0)
    npm version major  # for breaking changes (1.0.0 -> 2.0.0)
    npm publish --access public

Peer Dependencies

This package uses peer dependencies to avoid version conflicts. Make sure to install the required peer dependencies in your consuming application. Check package.json for the complete list of peer dependencies.