joe-bell/cva

Class Variance Authority

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 28 minutes ago
Added to GitGenius on September 9th, 2026
Created on January 2nd, 2022
Open Issues & Pull Requests: 2 (+0)
GitHub issues: Enabled
Number of forks: 138
Total Stargazers: 6,886 (+0)
Total Subscribers: 12 (+0)

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Issue API getrepoissuespagesummary failed: 429 Rate limit exceeded. Please try again later.

Detailed Description

CVA is a utility library for building type-safe component variants in TypeScript and JavaScript applications.

The tool solves the problem of managing CSS class combinations across component states and props. Rather than manually concatenating class names or maintaining separate style objects, CVA provides a structured way to define variants as a schema. Developers declare which props affect styling and what classes apply for each prop value, then CVA generates a function that composes the correct classes based on the props passed at runtime. This approach ensures type safety through TypeScript inference and prevents invalid prop-class combinations.

CVA suits projects using utility-first CSS frameworks like Tailwind CSS or similar approaches where components need multiple visual states. It works well in component libraries and design systems where consistency and maintainability across many variants matter. Teams building React, Vue, or framework-agnostic components benefit from the type checking and developer experience it provides. The tool is particularly valuable when component APIs need to be explicit about which prop combinations are valid, reducing bugs from accidental misconfigurations.

The project maintains active engagement with its community through documentation and issue responses. Development shows consistent attention to the codebase with regular updates addressing edge cases and user feedback. The maintainer demonstrates responsiveness to feature requests and bug reports, incorporating improvements based on real-world usage patterns. The project prioritizes backward compatibility while evolving the API based on developer needs.