vercel-composition-patterns

Refactor React components using compound components and lifted state providers.

Updated Apr 26, 2026
One-click install
npx skills add https://github.com/Elmanuel1/skills --skill vercel-composition-patterns-elmanuel1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/Elmanuel1/skills/tree/main/vercel-composition-patterns
Command: npx skills add https://github.com/Elmanuel1/skills --skill vercel-composition-patterns-elmanuel1

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the issue of unmaintainable React components that rely on boolean prop proliferation, which creates exponential conditional logic, makes component libraries hard to refactor, and introduces impossible state combinations as codebases scale.

Core Features & Use Cases

  • Anti-Boolean Prop Patterns: Eliminate unmaintainable boolean props by using explicit component variants and compound components for flexible, self-documenting UI.
  • Decoupled State Management: Implement generic context interfaces and lifted state providers to separate state logic from UI, enabling the same components to work with local, global, or synced state implementations.
  • React 19 Best Practices: Follow updated React 19 API guidelines for cleaner component definitions, including ref as a regular prop and the use() hook for context consumption.
  • Use Case: When building a reusable messaging UI library, use these patterns to create shared Composer components that work across channel, thread, edit, and forward flows without duplicated logic or conditional prop checks.

Quick Start

Use the vercel-composition-patterns skill to refactor your existing monolithic Composer component to use compound components and eliminate all boolean prop conditionals.

Frequently Asked Questions about vercel-composition-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor React components with too many boolean props?

Refactor React components with boolean prop proliferation by replacing conditional logic with compound components and explicit variants. This creates flexible, self-documenting UI that eliminates impossible state combinations as your codebase scales.

What's the best way to decouple state management from React UI components?

Decouple state management from React UI by implementing generic context interfaces and lifted state providers. This separates state logic from rendering, enabling the same components to work with local, global, or synced state implementations without changes.

How do compound components help build reusable React libraries?

Compound components help build reusable React libraries by splitting monolithic UI into composable parts. This allows shared components, like a messaging Composer, to work across different flows without duplicated logic or conditional prop checks.

Does this React composition approach work with React 19?

Yes, this React composition approach follows React 19 best practices, including treating ref as a regular prop and using the use() hook for context consumption to ensure cleaner component definitions.

When should I avoid using boolean props in React component architecture?

Avoid boolean props in React component architecture when they create exponential conditional logic, make libraries hard to refactor, or introduce impossible state combinations as your codebase scales.

How do I eliminate conditional logic in a monolithic React component?

Eliminate conditional logic in a monolithic React component by refactoring it to use compound components and generic context interfaces. This removes boolean prop conditionals and separates state management from your UI rendering.