compoundVariants
A CVA option that adds classes only when a specific combination of variants is chosen, such as intent danger with size lg.
In more detail
Ordinary variants each add their own classes. A compound variant covers the cases where the combination needs something extra that neither variant adds alone.
Related terms
- Class Variance Authority — A small JavaScript library that turns a component's variants, such as intent and size, into the right list of CSS classes.
- variant — A named option of a component, such as intent primary or danger and size sm or lg, each mapped to its own styling.
Taught in
- Class Variance Authority: Type-Safe Variant & Prop Orchestration — Design Systems & Component Engineering