NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #762 most downloaded on npm
Class Variance Authority 🧬
Last release 2 years ago
no release in 18 months
Ships unpredictably
gaps range from 9 days to 1.3 years
Most releases are documented
notes for 15 of 17 stable releases
1 version withdrawn
withdrawn after publishing
5 years old
27 releases · first in 2022
One column per quarter.
Add LICENSE Comments by @joe-bell in #283
Full Changelog: v0.7.0...v0.7.1
Nothing published for this version
Nothing published for this version
Nothing published for this version
Upgrade to clsx@2.0.0 by @joe-bell in #185
Add missing license key in package.json
Full Changelog: v0.6.0...v0.6.1
`cva` now uses `clsx` under-the-hood to concatenate classes with no breaking changes to the current experience and no increase to bundle-size.
cx → clsx by @joe-bell in https://github.com/joe-bell/cva/pull/152
cva now uses clsx under-the-hood to concatenate classes with no breaking changes to the current experience and no increase to bundle-size.
The existing cx export still exists, but as an alias of clsx
Bringing additional benefits of:
Provides additional support for booleans and variadic strings within class or className props
const button = cva([true && "button-base", false && "not-rendered"]);
// => 'button-base'
const buttonConsumer = button({ class: [true && "extra-class"] });
// => 'button-base extra-class'
Provides support for object syntax within class or className props
const button = cva({ foo: true, bar: false });
// => 'foo baz'
Full Changelog: https://github.com/joe-bell/cva/compare/v0.5.3...v0.6.0
Nothing published for this version
fix: issue #147 where map files are not present for esm files by @pfried in https://github.com/joe-bell/cva/pull/148
fix: issue #147 where map files are not present for esm files by @pfried in https://github.com/joe-bell/cva/pull/148
Thank you @pfried!
fix: Added explicit undefined type to support exactOptionalPropertyTypes option by @totto2727 in https://github.com/joe-bell/cva/pull/149
This has been a long standing issue for me and I'm so grateful to @totto2727 for making the fix
Full Changelog: https://github.com/joe-bell/cva/compare/v0.5.2...v0.5.3
Nothing published for this version
Support for moduleResolution: bundler (add types to exports field in package.json) by @msonnberger in https://github.com/joe-bell/cva/pull/138
moduleResolution: bundler (add types to exports field in package.json) by @msonnberger in https://github.com/joe-bell/cva/pull/138Full Changelog: https://github.com/joe-bell/cva/compare/v0.5.1...v0.5.2
> v0.5.0 is broken, please skip straight to v0.5.1
Warning
v0.5.0is broken, please skip straight tov0.5.1
Full Changelog: https://github.com/joe-bell/cva/compare/v0.4.0...v0.5.0
Note I'm actually supposed to be on vacation right now, but it seems like people are desperate for TypeScript 5 support
cva is a labour of love – I don't get paid to work on this project
Contributions of any size are greatly appreciated 🙏🏼
<details> <summary><strong>Ethereum</strong></summary>
0xC756F748ff6A499f3C826529A0Da30FF1A3ac28c
</details>
Nothing published for this version
Nothing published for this version
Target Multiple Variant Options within Compound Variants by @joe-bell and @JeroenReumkens in https://github.com/joe-bell/cva/pull/76
Target Multiple Variant Options within Compound Variants by @joe-bell and @JeroenReumkens in https://github.com/joe-bell/cva/pull/76
// components/button.ts
import { cva } from "class-variance-authority";
const button = cva("…", {
variants: {
intent: { primary: "…", secondary: "…" },
size: { small: "…", medium: "…" },
},
compoundVariants: [
// Applied via:
// `button({ intent: "primary", size: "medium" })`
// or
// `button({ intent: "secondary", size: "medium" })`
{
intent: ["primary", "secondary"],
size: "medium",
class: "…",
},
],
});
Full Changelog: https://github.com/joe-bell/cva/compare/v0.3.0...v0.4.0
Add Support for the `className` Prop by @joe-bell in https://github.com/joe-bell/cva/pull/54
Add Support for the className Prop by @joe-bell in https://github.com/joe-bell/cva/pull/54
React.js friends, you can be at peace: you can now use the className or the class prop.
Full Changelog: https://github.com/joe-bell/cva/compare/v0.2.4...v0.3.0
Nothing published for this version
Fix variant key 0 use-case by @Tatamethues in https://github.com/joe-bell/cva/pull/43
0 use-case by @Tatamethues in https://github.com/joe-bell/cva/pull/43Full Changelog: https://github.com/joe-bell/cva/compare/v0.2.3...v0.2.4
Remove class prop from VariantProps by @joe-bell (thanks for the suggestion @hasparus)
class prop from VariantProps by @joe-bell (thanks for the suggestion @hasparus)Full Changelog: https://github.com/joe-bell/cva/compare/v0.2.2...v0.2.3
Support for Typescript 4.7 (non-breaking change) by @joe-bell in https://github.com/joe-bell/cva/pull/34
Full Changelog: https://github.com/joe-bell/cva/compare/v0.2.1...v0.2.2
Nothing published for this version
Support Compiling TypeScript with --declaration Flag by @joe-bell in https://github.com/joe-bell/cva/pull/29
--declaration Flag by @joe-bell in https://github.com/joe-bell/cva/pull/29Full Changelog: https://github.com/joe-bell/cva/compare/v0.2.0...v0.2.1
Nothing published for this version
Improved/corrected support for boolean variants; both as a prop and defaultVariant
boolean variants; both as a prop and defaultVariantdefaultVariants styles can now be disabled/removed completely by setting the relevant variant as null
const button = cva("button", {
variants: {
disabled: { false: "button--enabled", true: "button--enabled" },
},
defaultVariants: {
disabled: false,
},
});
const buttonWithDefault = button();
// "button button--enabled"
const buttonWithoutDefault = button({ disabled: null });
// "button"
Full Changelog: https://github.com/joe-bell/cva/compare/v0.1.0...v0.2.0
Adds support for boolean variants (huge thanks to @mariusflorescu) 🚀
Adds support for boolean variants (huge thanks to @mariusflorescu) 🚀
const button = cva(["text-white", "bg-blue-700"], {
variants: {
disabled: {
true: "opacity-50",
false: "opacity-100",
},
},
});
button({ disabled: true });
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →