Build flexible component APIs that teams can compose instead of configure: compound components with context, headless hooks that separate behavior from markup, and when each pattern is worth it.
Every shared component starts simple. Then teams need variations:
1<Select
2 options={options}
3 placeholder="Pick one"
4 showIcons
5 iconPosition="right"
6 renderOption={(o) => ...}
7 groupBy="category"
8 showGroupHeaders
9 headerClassName="..."
10 footer={<CreateNewButton />}
11 footerSticky
12 virtualize
13 maxVisibleOptions={8}
14/>Each new requirement adds a prop. Soon the component has 40 props, half of which interact in ways nobody fully understands (what does footerSticky do when virtualize is on?). This is configuration-driven API design, and it fails at scale because:
The alternative is composition-driven API design: give consumers building blocks and let them arrange them. Two patterns dominate: compound components (structure via JSX) and headless components (behavior via hooks, markup entirely up to the consumer).