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

@popgrids/ui

v0.0.13

Published

A modern, production-ready React UI component library based on shadcn/ui principles, built with Base UI primitives and optimized for tree-shaking.

Readme

@popgrids/ui

A modern, production-ready React UI component library based on shadcn/ui principles, built with Radix UI primitives and optimized for tree-shaking.

Installation

pnpm add @popgrids/ui

Or with npm:

npm install @popgrids/ui

Peer Dependencies

This library requires the following peer dependencies:

  • react ^18 or ^19
  • react-dom ^18 or ^19.0.0
  • radix-ui ^1.4.3
  • tailwindcss ^4.0.0
  • @untitledui/icons ^0.1.0
  • @fontsource-variable/inter ^5.2.8
  • @fontsource/poppins ^5.2.7

Optional peer dependencies:

  • @tailwindcss/typography ^0.5.19

Requirements

  • React 19+
  • Tailwind CSS v4 configured in your project
  • TypeScript (recommended)

Usage

Step 1: Import the Theme CSS

Import the library's theme CSS file in your main CSS file (not in JavaScript). This file includes theme variables and tells Tailwind to scan the library's component files.

/* Your main CSS file (e.g., app.css, index.css, globals.css) */
@import "tailwindcss";
/* Import the library's theme and source definitions */
@import "@popgrids/ui/theme.css";

Step 2: Import and Use Components

import { Button } from "@popgrids/ui/button";

function App() {
  return <Button>Click me</Button>;
}

That's it! The @import "@popgrids/ui/theme.css" line:

  • Defines the library's theme variables
  • Tells Tailwind to scan @popgrids/ui/dist/**/*.{js,cjs} for class names
  • Automatically generates CSS for all classes used in the components

Variants

import { Button } from "@popgrids/ui/button";

function App() {
  return (
    <>
      <Button variant="default">Default</Button>
      <Button variant="outline">Outline</Button>
      <Button variant="secondary">Secondary</Button>
      <Button variant="ghost">Ghost</Button>
      <Button variant="destructive">Destructive</Button>
      <Button variant="link">Link</Button>
    </>
  );
}

Sizes

import { Button } from "@popgrids/ui/button";

function App() {
  return (
    <>
      <Button size="xs">Extra Small</Button>
      <Button size="sm">Small</Button>
      <Button size="default">Default</Button>
      <Button size="lg">Large</Button>
      <Button size="icon">Icon</Button>
    </>
  );
}

Using buttonVariants

You can also use the buttonVariants function directly for custom styling:

import { buttonVariants } from "@popgrids/ui";
import { cn } from "./lib/utils";

function CustomButton({ className, ...props }) {
  return (
    <button
      className={cn(buttonVariants({ variant: "outline", size: "lg" }), className)}
      {...props}
    />
  );
}

Theming

The library's theme is included when you import @popgrids/ui/theme.css. This file defines:

  1. Theme variables using Tailwind v4's @theme directive
  2. CSS variables for backward compatibility
  3. Source directives that tell Tailwind to scan the library's component files

Default Theme

The theme CSS file includes default design tokens. You can customize them by overriding the variables in your own CSS:

:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --primary: 221.2 83.2% 53.3%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 221.2 83.2% 53.3%;
  --radius: 0.5rem;
}

.dark {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 222.2 84% 4.9%;
  --card-foreground: 210 40% 98%;
  --popover: 222.2 84% 4.9%;
  --popover-foreground: 210 40% 98%;
  --primary: 217.2 91.2% 59.8%;
  --primary-foreground: 222.2 47.4% 11.2%;
  --secondary: 217.2 32.6% 17.5%;
  --secondary-foreground: 210 40% 98%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 210 40% 98%;
  --border: 217.2 32.6% 17.5%;
  --input: 217.2 32.6% 17.5%;
  --ring: 224.3 76.3% 48%;
}

Customizing Theme Variables

You can customize any variable to match your design system. Simply override the values in your CSS:

:root {
  --primary: 221.2 83.2% 53.3%; /* Your primary color */
  --radius: 0.5rem; /* Your border radius */
  /* Customize other variables as needed */
}

Dark Mode

Apply the .dark class to your root element to enable dark mode:

<html className="dark">
  {/* Your app */}
</html>

Tree-Shaking

This library is fully tree-shakeable. When you import only the components you need:

import { Button } from "@popgrids/ui/button";

Your bundler will only include the Button component and its dependencies, not unused exports.

How It Works

When you import @popgrids/ui/theme.css in your main CSS file:

  1. Theme variables are defined using Tailwind v4's @theme directive
  2. CSS variables are set for backward compatibility (used in component classes like hsl(var(--primary)))
  3. @source directive tells Tailwind to scan @popgrids/ui/dist/**/*.{js,cjs} for class names
  4. Tailwind generates CSS for all classes found in the library's components
  5. No manual configuration needed - the @source directive handles everything!

Requirements

  • Tailwind CSS v4 (required for @theme and @source directives)
  • Import @popgrids/ui/theme.css in your main CSS file (not in JavaScript)

TypeScript

Full TypeScript support is included. All components are typed and exported with their proper types.

Changesets

This library uses Changesets to manage versions. To create a new version, run:

pnpm changeset

This will open an interactive prompt to help you create a changeset.

Once you've created a changeset, run:

pnpm changeset version

This will update the version in the package.json file and create a new git tag.

Then push the changes to the repository:

git push origin main

And finally, publish the package:

pnpm changeset publish

This will publish the package to the npm registry.

License

MIT