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

@chameleon-ui-lib/react

v1.0.3

Published

Chameleon UI Core Library

Downloads

650

Readme

Chameleon UI

npm license React

One component library. Five complete design systems. Switch themes at runtime with a single prop.

Material · Simple · Minimalist · Glassy · Liquid

Each theme ships with a full light and dark mode, its own typography, spacing, and ambient backgrounds — no CSS overrides required.


Install

npm install @chameleon-ui-lib/react

Framework Setup (Vite + React + TypeScript + Tailwind v4)

This is the recommended known-good configuration for new projects.

1. Create your project

npm create vite@latest my-app -- --template react-ts
cd my-app
npm install

2. Install Tailwind v4 and Chameleon UI

npm install -D tailwindcss @tailwindcss/vite
npm install @chameleon-ui-lib/react

3. Configure Vite (vite.config.ts)

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";

export default defineConfig({
  plugins: [
    react(),
    tailwindcss(),   // Tailwind v4 uses a Vite plugin — no tailwind.config.ts needed
  ],
});

Tailwind v4 Note: There is no tailwind.config.ts in v4. Configuration is handled via the Vite plugin and CSS directives.

4. Set up your CSS entry (src/index.css)

@import "tailwindcss";
@import "@chameleon-ui-lib/react/styles";

Import order matters: @import "tailwindcss" must come before the library styles. If PostCSS warns "@import must precede all other rules", check that no other CSS rules appear above the @import lines in your entry file.

5. Import CSS in your entry file (src/main.tsx)

import "./index.css";
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";

ReactDOM.createRoot(document.getElementById("root")!).render(
  <React.StrictMode>
    <App />
  </React.StrictMode>
);

6. Wrap your app with ChameleonProvider (src/App.tsx)

import { ChameleonProvider, Button, Card } from "@chameleon-ui-lib/react";

export default function App() {
  return (
    <ChameleonProvider initialTheme="glassy" initialMode="dark">
      <Card>
        <Button>Get Started</Button>
      </Card>
    </ChameleonProvider>
  );
}

7. (Optional) Run chameleon init to scaffold components

npx @chameleon-ui-lib/react init

This creates chameleon.config.json and auto-configures Tailwind in your vite.config.ts.


Quick Start (existing project)

import "@chameleon-ui-lib/react/styles";
import { ChameleonProvider, Button, Card } from "@chameleon-ui-lib/react";

export default function App() {
  return (
    <ChameleonProvider initialTheme="glassy" initialMode="dark">
      <Card>
        <Button>Get Started</Button>
      </Card>
    </ChameleonProvider>
  );
}

Switch themes at runtime — no page reload, no flash:

const { setTheme, setMode } = useChameleon();

setTheme("liquid");   // material | simple | minimalist | glassy | liquid
setMode("light");     // light | dark

What's Included

| Layer | Components | |---|---| | Atoms | Button Input Badge Progress Spinner Label Switch Checkbox | | Molecules | Card Tabs Dialog Alert StatCard PricingCard Avatar Tooltip Select Textarea | | Organisms | DataTable Charts KanbanBoard Calendar FileUpload Gallery CommandPalette | | Auth | LoginForm SignupForm TwoFactorForm MagicLinkForm ForgotPassword ResetPassword | | Templates | Dashboard · Landing · Settings · Inbox · Analytics · Docs | | Animations | Animated AnimatedList — theme-matched motion presets |


CLI

Scaffold components and templates directly into your project:

# Initialize Chameleon in an existing project
npx @chameleon-ui-lib/react init

# Copy a component into your source tree
chameleon add button
chameleon add data-table

# Copy a full-page template
chameleon template dashboard

# Set the active theme in chameleon.config.json
chameleon theme glassy

# List everything available
chameleon list

# Health check — verifies your setup
chameleon doctor

The CLI reads/writes chameleon.config.json at your project root and copies files into the directory you configure (src/components/ui by default).


Theme Tokens

All components read from CSS custom properties — override any token to extend a theme without touching component code:

:root {
  --primary: 262 83% 58%;
  --card: 0 0% 100%;
  --radius: 0.75rem;
}

Troubleshooting

PostCSS @import must precede all other rules

This happens when @import statements appear after non-import CSS rules. Fix: ensure your CSS entry file starts with imports and contains no rules before them:

/* ✅ Correct order */
@import "tailwindcss";
@import "@chameleon-ui-lib/react/styles";

/* your custom rules below */
:root { --my-token: red; }
/* ❌ Wrong — rule before import */
:root { --my-token: red; }
@import "tailwindcss";

Run chameleon doctor to auto-detect this issue in your project.

Tailwind classes not applying

Make sure @tailwindcss/vite is in your vite.config.ts plugins array — in Tailwind v4 there is no tailwind.config.ts. Run chameleon init to auto-inject the plugin if it is missing.

Theme not switching

Wrap your entire app tree with <ChameleonProvider>. The provider must be an ancestor of every component that uses useChameleon().

Components directory not found

Run chameleon init first — it creates chameleon.config.json and the configured output directory.


License

MIT