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

@trackunit/css-class-variance-utilities

v2.0.14

Published

The `@trackunit/css-class-variance-utilities` package is a thin wrapper around the upstream [`cva`](https://cva.style/beta) package with [`tailwind-merge`](https://github.com/dcastil/tailwind-merge) wired into its `onComplete` hook, so later conflicting u

Readme

Trackunit css-class-variance-utilities

The @trackunit/css-class-variance-utilities package is a thin wrapper around the upstream cva package with tailwind-merge wired into its onComplete hook, so later conflicting utilities win and callers do not need to call twMerge themselves. Use cva for a variant table and cx from this package to join class strings — both go through that hook.

Usage

Import cva and cx from this package rather than from cva directly:

import { cva } from "@trackunit/css-class-variance-utilities";

export const cvaPage = cva({
  base: ["grid", "h-full"],
  variants: {
    layout: {
      content: ["grid-rows-1"],
      none: [],
    },
  },
  defaultVariants: { layout: "none" },
});

Because cx goes through the same hook, it resolves conflicts too: cx("p-2", "p-4") returns "p-4".

Authoring guide (what to write in a .variants.ts file, and when to use cx): Storybook Foundations → Styling variants.

To compose variant functions, use the composes property on a cva config.

Migrating from cvaMerge

cvaMerge is gone. There is no compatibility shim: bumping this package without running the migration is a compile failure, not a deprecation warning.

The old call took the base classes as a positional argument; cva takes a single config object with a base property:

// before
cvaMerge(["grid", "h-full"], { variants: { … } });
// after
cva({ base: ["grid", "h-full"], variants: { … } });

Run these two commands in the consuming repo after bumping the dependency:

nx g @trackunit/migrations:migrate
nx g @trackunit/migrations:run-migrations

migrate discovers this package's pending migration and writes it to trackunit-migrations.json. run-migrations applies it. A second run is a no-op — already-applied identities are recorded and skipped.

The codemod rewrites the imports and the call shape, preserving comments and formatting. Any call site it can't rewrite with confidence — a base or config built at runtime, or an aliased import — is left untouched and printed with its file and line. Fix those by hand; the run never guesses at classnames it wasn't sure about.

null variant props

cva 0.7 accepted null for a variant prop and suppressed that variant. cva 1.0's types reject null, and at runtime null falls through to the variant's defaultVariants entry. The codemod rewrites variant definitions, not their consumers, so these surface as type errors after migrating.

undefined is the replacement, but the two are only equivalent when that variant key has no defaultVariants entry. Where a default exists, undefined silently applies the default class instead of no class.

Pinned prerelease

This package depends on [email protected], pinned exactly (no caret). The bare cva npm name's latest dist-tag resolves to an unrelated squatted package, and a future stable 1.0.0 may require another migration — the composition primitive in particular has already changed shape between betas.

For more info and a full guide on Iris App SDK Development, please visit our Developer Hub.

Development

At this point this library is only developed by Trackunit Employees.
For development related information see the development readme.

Trackunit

This package was developed by Trackunit ApS. Trackunit is the leading SaaS-based IoT solution for the construction industry, offering an ecosystem of hardware, fleet management software & telematics.

The Trackunit logo