What problem does it solve?
Many React components become hard to maintain when they rely on multiple boolean props and monolithic conditionals; this Skill provides patterns to replace mode flags with explicit, composable component variants and provider-based state so components remain clear, testable, and easy to reason about by humans and agents.
Core Features & Use Cases
- Composition-first patterns: Use compound components and children composition instead of boolean props or render props to make UI structure explicit.
- Provider-based state: Lift state into providers and define a generic context interface (state, actions, meta) so the same UI works with different state implementations.
- Explicit variants & React 19 guidance: Create clear variant components (ThreadComposer, EditComposer, etc.) and follow React 19 conventions like use() and ref-as-prop.
- Use Case: Refactor a messaging composer to remove isEditing/isThread flags, expose a Composer.Provider, and implement ChannelComposer, ThreadComposer, and EditComposer variants.
Quick Start
Refactor the Composer component to replace boolean props with compound components and a provider-based context following the vercel-composition-patterns guidelines.