boolean prop
A component option that is just true or false, such as isPrimary or hasIcon.
In more detail
One or two are fine, but they multiply: every new flag doubles the possible combinations, many of which make no sense, such as isPrimary and isDanger together. This prop explosion makes components fragile. Variants and composition are the usual cures.
Related terms
- combinatorial explosion — The rapid growth in possible combinations as independent options are added: n on/off flags give 2 to the power n combinations.
- variant — A named option of a component, such as intent primary or danger and size sm or lg, each mapped to its own styling.
- composition — Building a component out of smaller components that the consumer assembles, instead of configuring one big component with flags.
- monolithic component — One large component that handles every variation through a long list of configuration props.
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