# CVA

[BASE product page](<https://base.akulich.dev/en/library/cva/>) · [Resource](<https://github.com/joe-bell/cva>)

ID: cva · Language: en
Schema version: 1 · Data version: cbbe7123b47a5ae80983

This is editorial data. An unknown field neither confirms nor rules out a capability.
dataVersion is a dataset fingerprint, not evidence of a recent fact check.

Class Variance Authority: it defines component variants and maps prop combinations to CSS classes and TypeScript types\.

## Type

UI library

## Entry type

library

## Separate catalog

No

## [Access conditions](<https://base.akulich.dev/en/library/cva/#resource-access>)

free

## [What you can use for free](<https://base.akulich.dev/en/library/cva/#resource-access>)

Code and local use under Apache\-2\.0\.

## [Paid features and costs](<https://base.akulich.dev/en/library/cva/#resource-access>)

Computing resources, self\-hosting, and external services are paid for separately if used\.

## [Access and limitations](<https://base.akulich.dev/en/library/cva/#resource-access>)

Code and local use under Apache\-2\.0\. Computing resources, self\-hosting, and external services are paid for separately if used\.

## [Use cases](<https://base.akulich.dev/en/library/cva/#resource-tasks>)

- Define typed UI component variants
- Connect prop combinations to class rules and test compound variants

## Category IDs

- frontend
- design

## Subcategory IDs

- frontend\.components
- design\.systems

## Tags

- CVA
- UI
- Development

## Also known as

- joe\-bell/cva
- class\-variance\-authority
- cva

## [Selection purpose](<https://base.akulich.dev/en/library/cva/#resource-selection>)

Define typed UI component variants

## [Choose this when](<https://base.akulich.dev/en/library/cva/#resource-selection>)

- Define typed UI component variants
- Connect prop combinations to class rules and test compound variants

## [Requirements](<https://base.akulich.dev/en/library/cva/#resource-selection>)

- The application defines classes and CSS; CVA does not provide a standalone visual component library\.

## [Limitations](<https://base.akulich.dev/en/library/cva/#resource-selection>)

- Costs and limits of free use: Computing resources, self\-hosting, and external services are paid for separately if used\.
- Terms of use: Apache\-2\.0 for the code; third\-party components retain their own terms\.

## [Questions before use](<https://base.akulich.dev/en/library/cva/#resource-faq>)

### What can you use for free in CVA?

Code and local use under Apache\-2\.0\.

### What additional costs might arise with CVA?

Computing resources, self\-hosting, and external services are paid for separately if used\.

### What terms of use matter for CVA?

Apache\-2\.0 for the code; third\-party components retain their own terms\.

### How do you get started with CVA?

Identify component size, appearance, and state variants\. Connect prop combinations to class rules and test compound variants\. Configure styles and check empty, loading, and error states\.

### What are compoundVariants and defaultVariants for?

CVA assembles classes from variants, including booleans\. defaultVariants defines defaults; compoundVariants adds classes for combined conditions\. Tailwind is optional\. The documentation recommends SSR/SSG for static components to avoid sending unnecessary JavaScript to browsers\.

## Sources for the selection guide

- [https://github\.com/joe\-bell/cva](<https://github.com/joe-bell/cva>)
- [https://raw\.githubusercontent\.com/joe\-bell/cva/HEAD/README\.md](<https://raw.githubusercontent.com/joe-bell/cva/HEAD/README.md>)
- [https://raw\.githubusercontent\.com/joe\-bell/cva/HEAD/LICENSE](<https://raw.githubusercontent.com/joe-bell/cva/HEAD/LICENSE>)
- [https://www\.open\-source\-tools\.com/](<https://www.open-source-tools.com/>)
- [https://cva\.style/getting\-started/variants/](<https://cva.style/getting-started/variants/>)

## [Possible workflow](<https://base.akulich.dev/en/library/cva/#resource-scenario>)

Define typed UI component variants\.

A possible workflow; this is not a report of hands-on testing.

## Before you start

- The component's design, states, and data\.
- A compatible framework and the project's styles\.

## Steps

1. Identify component size, appearance, and state variants\.
2. Connect prop combinations to class rules and test compound variants\.
3. Configure styles and check empty, loading, and error states\.

## Check your result

- The keyboard, focus indicators, and a screen reader let users complete the action\.
- The component works on a narrow screen and with long data values\.

## [License](<https://base.akulich.dev/en/library/cva/#resource-license>)

Apache\-2\.0 for the code; third\-party components retain their own terms\.

## License explanations for the specified scope

### Apache 2\.0 — permissive license with patent terms

You can use and modify the code in commercial and closed\-source projects\. When distributing it, retain the license and relevant notices, identify modified files, and include NOTICE if provided\. Authors grant a limited patent license for their contributions; it does not grant permission to use trademarks\.

[License terms](<https://www.apache.org/licenses/LICENSE-2.0>)

## [Sources](<https://base.akulich.dev/en/library/cva/#resource-sources>)

- [Official source](<https://github.com/joe-bell/cva>)
- [Official source](<https://raw.githubusercontent.com/joe-bell/cva/HEAD/README.md>)
- [License](<https://raw.githubusercontent.com/joe-bell/cva/HEAD/LICENSE>)
- [Catalog / discovery source](<https://www.open-source-tools.com/>)
- [Official source](<https://cva.style/getting-started/variants/>)

## Editorial review date

2026\-10\-06

## Editorial review scope

The purpose, current repository license, and separate terms for code, services, and models have been reviewed\. The product was not run, and no security audit was performed\.

Dates refer to the stated editorial review, not hands-on testing, a product update, or a recent review of all sources.
