Sourcemap Explorer
Stack · npm package

class-variance-authority

Class Variance Authority 🧬

latest 0.7.1· Apache-2.0· 27 versions publishedView on npm

About

Class Variance Authority 🧬

Class Variance Authorityclass-variance-authorityclassesclassnameclassnamescsscvastitchesvanilla-extractvariants

What detecting class-variance-authority tells you about a site

class-variance-authority (cva) reveals a typed, variant-driven approach to component styling on top of Tailwind — defining size/intent/state variants as data rather than ad-hoc class strings. Its presence is one of the clearest fingerprints of a shadcn/ui-style design system built for reuse and type safety.

Why the exact class-variance-authority version matters

cva's API is small and stable; the version is mostly a freshness and compatibility signal against the surrounding Tailwind tooling.

class-variance-authority in a real-world stack

When you find class-variance-authority in a bundle, it rarely travels alone. clsx, tailwind-merge, tailwindcss and @radix-ui primitives — the canonical shadcn/ui stack.

Quick facts

Latest version0.7.1
LicenseApache-2.0
AuthorJoe Bell
Installnpm install class-variance-authority
Direct dependencies1

What class-variance-authority pulls in

class-variance-authority declares 1 direct dependency — each one also rides into any bundle that ships class-variance-authority, so they are detection targets too. Reading them is a quick way to understand the package's real footprint .

How Sourcemap Explorer detects class-variance-authority

class-variance-authority ships as v0.7.1, published 2024-11-26 and carries 1 direct dependency, 27 versions on the registry. Those exact numbers are the footprint Sourcemap Explorer matches when class-variance-authority rides inside a deployed bundle — here is how the detection works.

We catch class-variance-authority from two complementary signals: bundled source paths and the embedded package.json. Modern bundlers (webpack, Vite, esbuild, Rollup, Turbopack) preserve the original node_modules/class-variance-authority/ paths inside the JavaScript sourcemap's sources[] array — that's the canonical signal. When the matching package.json is also captured in sourcesContent[], we read the exact version field — patch number included. No regex guessing, no version inference.

  1. 1

    Confirm the site exposes sourcemaps

    In DevTools Network, check the response headers of any application script for `SourceMap` or `X-SourceMap`. Failing that, fetch the script's last 4 KB and look for a `//# sourceMappingURL=` comment — that map is where the `class-variance-authority` paths live.

  2. 2

    Find the package in the bundle

    Open DevTools → Network → reload. Click any application script and look at its sourcemap. Inside, search `sources[]` for entries matching `node_modules/class-variance-authority/` — every match confirms the package is bundled. The matching `sourcesContent[i]` for `node_modules/class-variance-authority/package.json` gives you the exact installed version.

  3. 3

    Read the version directly from package.json

    Run `jq -r '. as $m | $m.sources | to_entries[] | select(.value | endswith("node_modules/class-variance-authority/package.json")) | $m.sourcesContent[.key] | fromjson | .version' bundle.js.map`. Sourcemap Explorer automates the same query in the popup.

Recent versions

Version
Released
0.7.1
2024-11-26
0.7.0
2023-07-17
0.6.1
2023-06-26
0.6.0
2023-04-27
0.5.3
2023-04-26
0.5.2
2023-04-11
0.5.1
2023-04-02
0.5.0
2023-04-02

class-variance-authority README

Live mirror of the GitHub README, for reference. Updated whenever the repo's default branch changes.

CVA

cva

Class Variance Authority

Read the Docs 📖

NPM Version Types Included Minizipped Size Apache-2.0 License NPM Downloads Follow Joe Bell on Bluesky


Documentation

Visit cva.style to get started.

License

Apache-2.0 License © Joe Bell

FAQ

What is class-variance-authority used for?

Class Variance Authority 🧬

How can I tell if a website is using class-variance-authority?

Open the page in Chrome with the Sourcemap Explorer extension installed and read the Stack tab. We catch `class-variance-authority` from two complementary signals: `node_modules/class-variance-authority/` paths inside the JavaScript sourcemap, and the embedded `package.json` we read for exact-version detection. Without the extension you can do the same lookup manually in DevTools — the steps are listed in the "How Sourcemap Explorer detects" section above.

How do I find out which version of class-variance-authority a website is running?

Read it straight from the site's JavaScript sourcemap. When a build ships source maps, the bundled `class-variance-authority/package.json` carries the exact `version` string — Sourcemap Explorer extracts it in one click on the Stack tab, and you can do it by hand in DevTools by opening the `.map` file and searching for `node_modules/class-variance-authority/package.json`. That is far more reliable than inferring the version from an asset-hash or a `?ver=` query string, which is all surface-level detectors have to go on. The current npm release is 0.7.1, but real deployments frequently run an older pinned version — which is exactly why reading the bundled number matters.

What is the latest version of class-variance-authority?

0.7.1, as published on the npm registry. The "Recent versions" table on this page lists the most recent 8 releases with their release dates. Sourcemap Explorer reports the version actually bundled into a site, which can lag the latest release by months on real-world deployments.

Is class-variance-authority actively maintained?

Maintained but slow-moving — releases come every several months rather than weekly. The last published release was 2024-11-26. Source code: https://github.com/joe-bell/cva.

Where can I read more?

Project homepage: https://github.com/joe-bell/cva#readme. Source code: https://github.com/joe-bell/cva. Published on npm: https://www.npmjs.com/package/class-variance-authority. Licensed as Apache-2.0.

Keep reading on Sourcemap Explorer

Practical guides

Detection deep dives

Detected by Sourcemap Explorer

When a bundle ships sourcemaps, we read the embedded package.json for class-variance-authority and report the precise version (the registry's latest is v0.7.1, published 2024-11-26; the bundled copy is often older). Without sourcemaps, an import / require in the page's scripts is enough to flag it.

Install free on Chrome