What problem does it solve?
This Skill helps you stop React component complexity from growing when behavior is controlled by many boolean props, and it guides you toward composable component design that supports maintainability and reuse.
Core Features & Use Cases
- Eliminates boolean prop proliferation by using explicit variants that render only the UI and actions relevant to a given mode.
- Uses compound components with shared context so subcomponents receive state/actions/meta via a provider instead of prop drilling.
- Lifts state into provider components to enable sibling or external UI (like previews and buttons) to read and act on shared state.
- Decouples UI from state implementation so the same components work with local state, global synced state, or server-driven data.
- Introduces a generic context interface (state/actions/meta) to enable dependency-injected providers.
- Applies children over render props for cleaner composition, while reserving render props for cases where data needs to flow downward.
- Aligns with React 19 APIs by using
use() for context access and treating ref as a regular prop.
Quick Start
Use the vercel-composition-patterns skill to refactor a complex React component that currently uses boolean props into explicit variant components that share state through a context provider.