What problem does it solve?
React component libraries often suffer from boolean prop proliferation, which leads to dense conditional logic and brittle APIs. This Skill demonstrates how to replace boolean flags with explicit variants, compound components, and context-driven state to build scalable, maintainable UI.
Core Features & Use Cases
- Create explicit variant components (ThreadComposer, EditMessageComposer, ForwardMessageComposer) that assemble UI from shared parts without boolean flags.
- Use compound components with a shared context (Composer.Frame, Composer.Input, Composer.Footer, etc.) to avoid prop drilling.
- Lift and inject state via providers so UI components can be reused with different underlying state implementations (local vs global).
- Incorporate React 19 API guidance (use() instead of useContext, ref as a regular prop) in safe, forward-compatible patterns.
- Real-world use cases include refactoring large codebases, designing reusable component libraries, and building flexible component APIs.
Quick Start
Create a ThreadComposer variant that demonstrates explicit composition using the Frame and shared subcomponents.