What problem does it solve?
Many React components become fragile and hard to maintain when behavior is controlled by many boolean props and conditional logic. This Skill provides patterns to replace boolean-prop proliferation with explicit, composable component variants, provider-based state, and shared context so components remain predictable, testable, and reusable.
Core Features & Use Cases
- Compound Components & Context: Teach teams to structure complex UI as small composable pieces that consume a shared context rather than relying on prop drilling.
- Provider-Based State & Dependency Injection: Lift state into providers with a clear state/actions/meta interface so the same UI works with local or global state implementations.
- Explicit Variants & Composition: Replace boolean modes with named variant components (e.g., ThreadComposer, EditComposer) to make intent explicit and eliminate hidden conditionals.
- React 19 Guidance: Notes on React 19 API changes such as using use() and treating ref as a regular prop for modern codebases.
- Use Cases: Refactoring legacy components that use many boolean flags, designing reusable component libraries, and running architecture-focused code reviews.
Quick Start
Use the vercel-composition-patterns guidance to refactor components that use many boolean props into explicit compound components wired to provider-based state.