Open-source project
joe-bell/cva avatar
joe-bell/cva

cva (Class Variance Authority): a one-line README, a 1.0 beta line, and a pnpm-only monorepo behind it

Class Variance Authority

6,918 stars146 forksTypeScriptApache-2.0

At a glance

What is it?
joe-bell/cva is the source of the class-variance-authority npm package. The repository front page sends you to cva.style for all usage, while the repo itself is a pnpm workspace with separate examples for the latest and beta lines, benchmark tooling, and files aimed at coding agents.
Who is it for?
Read the repository if you need to know which release line you are on or plan to contribute; read cva.style if you need to know how to call the library, because the README carries no usage at all. Contributors who do not use pnpm, or who object to an install step rewriting core.hooksPath, will hit friction immediately.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 23, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • joe-bell/cva6,918 ★ · +13
Star history
Repository2026-10-072026-11-23
joe-bell/cva6.9k6.9k

13 Stars in the last 47 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The README is a signpost: every usage question goes to cva.style

The repository is named cva, the project calls itself Class Variance Authority, and the package on npm is class-variance-authority. Those three names refer to the same thing, which matters when you search for it or add it to a manifest.

The README itself contains a title, a row of badges linking to npm, Bundlephobia, the license and a Bluesky profile, one Documentation heading that says to visit cva.style to get started, and a license line. There is no install command, no code sample, and no API listing on the GitHub front page. Anyone evaluating the library from GitHub alone learns its name, license and package name, and nothing about how it is called.

The practical consequence is that the documentation site is a dependency of your understanding. If cva.style is down or describes a different release line than the one you installed, the repository front page gives you no fallback. The docs source does live in the repository under docs/, and a docs script runs it locally with pnpm run --filter './docs' dev.

Two release lines sit side by side in examples/latest and examples/beta

The examples directory is split into examples/latest and examples/beta. That split mirrors the release history. The three most recent GitHub releases are v1.0.0-beta.10 on 2026-09-14, v1.0.0-beta.11 on 2026-09-15, and v1.0.0-beta.12 on 2026-09-17. All three are betas, released within four days of each other.

For a user this means there are two things called cva at once: whatever npm serves as the latest version, and the 1.0 beta series. The examples folder keeps a working project for each, and a build:examples script builds them all in parallel with pnpm --filter './examples/**' --parallel build.

What the repository front page does not tell you is what changed between the two lines or whether code written for one runs unchanged on the other. If you copy a snippet from a blog post or a component library, you need to check which line it targets before assuming it matches the version in your lockfile.

The workspace refuses npm and Yarn before installing anything

The root package.json is private, typed as an ES module, and named root. Its preinstall hook runs this:

sh
npx only-allow pnpm

Running npm install or yarn install in a clone fails at that hook, before dependencies are fetched. The workspace layout is defined in pnpm-workspace.yaml and locked in pnpm-lock.yaml, and most root scripts are pnpm filter commands that fan out across packages/, examples/ and docs/.

The repository also pins a Node version in both .node-version and .nvmrc. The specific version is recorded in those files rather than in the root package.json, so check them before installing.

None of this affects people who only install class-variance-authority from npm into their own project. It affects anyone who wants to run the tests, try a fix, or read the code with working type checking: the price of entry is having pnpm and the pinned Node version available.

A fresh install rewires git hooks and builds every package

The prepare script runs every script whose name starts with prepare:, and there are two. prepare:packages runs pnpm build, which in turn runs the build script inside every package under packages/. prepare:hooks runs:

sh
git config core.hooksPath .github/hooks

That command changes your local git configuration for the clone so that hooks are read from .github/hooks instead of .git/hooks. Any personal hooks you keep in .git/hooks for that clone stop running, without a prompt. Commits then go through a lint-staged step configured in .config/lint-staged.config.ts, and formatting uses Prettier with plugins for Astro, package.json files and Tailwind CSS.

The effect is that the first install is slower than a plain dependency fetch, because it compiles the packages, and that contributors inherit the project's commit checks automatically. If you rely on your own hooks, you need to undo or adapt the core.hooksPath setting after installing.

Performance and bundle size are checked in the repo, but no figures are published on the front page

The root scripts include a benchmark suite. bench builds the packages, runs vitest bench with the shared config in .config/vitest.config.ts, and then runs a report script from a workspace package named bench. Sibling scripts named bench:baselines, bench:check, bench:compare and bench:preview call the same package to record baselines, check results against them, compare runs, and preview output.

A separate bundlesize script runs in parallel across every package under packages/. The README badge row links to Bundlephobia for class-variance-authority.

What the repository front page does not give you is a number. There is no benchmark table or size figure in the README, so you cannot quote cva's speed or weight from GitHub alone. If those numbers matter for your decision, you have to run pnpm bench locally or open the Bundlephobia page and read the current figure for the version you plan to install.

Agent instructions and skills are first-class files in the repository

The top level of the repository carries AGENTS.md, CLAUDE.md, REVIEW.md, a .mcp.json file, a .claude/ directory, an .agents/ directory, a skills/ directory, skills-lock.json, skill-check.config.json and registry.json. Editor settings for both VS Code and Zed are committed as well.

The skills are linted. The lint:skills script runs:

sh
skill-check check --no-security-scan --strict

The --no-security-scan flag in that command turns the security scan off for that run. Anyone reusing these skill files in their own setup should note that the repository's own lint does not include that scan.

For contributors, the presence of AGENTS.md and CLAUDE.md means the project has written instructions aimed at coding assistants alongside CONTRIBUTING.md, CODE_OF_CONDUCT.md and REVIEW.md. Reading those files before opening a pull request tells you what the maintainer expects, whether the change is written by hand or with an assistant.

Dependency versions are pinned exactly and kept aligned across packages

The root devDependencies use exact versions rather than ranges: @types/node 24.13.2, @vitest/coverage-v8 4.1.5, lint-staged 17.0.3, prettier 3.8.3, prettier-plugin-astro 0.14.1, prettier-plugin-packagejson 3.0.2 and prettier-plugin-tailwindcss 0.8.0. Two scripts, syncpack:lint and syncpack:fix, check and repair version agreement across the workspace packages.

The test command runs Vitest with coverage:

sh
vitest --config .config/vitest.config.ts run --coverage

Type checking for the repository's own scripts runs separately through tsc with .config/tsconfig.scripts.json and --noEmit, and the check script runs every check: script in parallel.

The last push to the repository was on 2026-11-02. The code is licensed under Apache-2.0, copyright Joe Bell. Pinning exact versions makes the repository's own builds reproducible, but it also means a contributor's pull request that bumps one tool has to pass syncpack as well.

Editorial conclusion

Read the repository if you need to know which release line you are on or plan to contribute; read cva.style if you need to know how to call the library, because the README carries no usage at all. Contributors who do not use pnpm, or who object to an install step rewriting core.hooksPath, will hit friction immediately. Before adopting, check whether your project should track the stable package or the v1.0.0 beta series, since the three most recent releases are all betas.

Frequently asked questions

What is Joe Bell's cva about?

cva stands for Class Variance Authority, a TypeScript project by Joe Bell published on npm as class-variance-authority. Its documentation lives at cva.style.

Is cva 1.0 stable?

The three most recent cva releases on GitHub are betas: v1.0.0-beta.10, v1.0.0-beta.11 and v1.0.0-beta.12, published in September 2026. The repository keeps separate examples for the latest and beta lines.

Can I contribute to cva with npm or Yarn?

No. The cva repository runs npx only-allow pnpm as a preinstall hook, so installing with npm or Yarn fails. Use pnpm.

Where is the cva API documented?

The cva README contains no API reference and points to cva.style. The documentation source is in the repository's docs/ directory.

Official sources

  1. joe-bell/cva on GitHub
  2. License: Apache-2.0
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/joe-bell-cva.svg)](https://hysenlabs.com/projects/joe-bell-cva)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/joe-bell-cva.svg)](https://hysenlabs.com/projects/joe-bell-cva)

Was this useful?