combinatorial explosion
The rapid growth in possible combinations as independent options are added: n on/off flags give 2 to the power n combinations.
In more detail
Five boolean props already give 32 combinations to design, test and document. Replacing them with a few variant axes with fixed options, or with composition, keeps the number of valid states small.
Related terms
- boolean prop — A component option that is just true or false, such as isPrimary or hasIcon.
- 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
- Component API Ergonomics: Composition vs Boolean Config Props — Design Systems & Component Engineering