Skip to content
React Libraries
On this page

Class Variance Authority

Utilities for defining component variants as sets of CSS classes.

What it does

Utilities for defining component variants as sets of CSS classes.

When it fits

Managing size, color, and state variants in a component system.

Other options in this category

  • chroma.js — Generating palettes and color scales for interfaces or charts.
  • clsx — Building className values from component states and optional styles.
  • CSS Modules — Writing stylesheets without exposing every class name globally.
  • Emotion — Building component-level styles with a flexible CSS-in-JS API.
  • Fancy ANSI — Showing colored command output inside browser-based interfaces.

Source

Project source for Class Variance Authority ↗

Editorial overview reviewed on October 24, 2026. Follow the source for current setup, compatibility, and licensing.

Style and theme components →

All styling & themes options →