vercel-composition-patterns

Refactor React components using compound components and context providers.

567|82|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/pedronauck/skills --skill vercel-composition-patterns-pedronauck
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/pedronauck/skills/tree/main/skills/vercel-composition-patterns
Command: npx skills add https://github.com/pedronauck/skills --skill vercel-composition-patterns-pedronauck

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexity of managing React components by providing patterns to avoid prop proliferation and create more maintainable, flexible, and scalable codebases.

Core Features & Use Cases

  • Avoid Boolean Prop Proliferation: Refactor components that rely heavily on boolean props into more composable structures.
  • Compound Components: Learn to build complex components using shared context for flexible composition.
  • State Management Patterns: Implement robust state management by lifting state into provider components and defining generic context interfaces.
  • React 19 APIs: Understand how to leverage new React 19 features like use() and simplified ref handling.
  • Use Case: When refactoring a large form component that has become unwieldy due to numerous conditional rendering props, apply these patterns to break it down into smaller, reusable, and more manageable pieces.

Quick Start

Apply compound component patterns to refactor the Composer component by using shared context instead of render props.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I avoid boolean prop proliferation when building scalable React components?

To avoid boolean prop proliferation in React components, refactor them into explicit component variants and compound components. This pattern replaces conditional rendering props with composable structures, resulting in more maintainable and flexible codebases.

What is the compound components pattern and how does it manage state in React?

The compound components pattern in React builds complex UI elements using shared context providers instead of render props. It manages state effectively by lifting state into provider components and defining generic context interfaces for flexible composition.

How do I refactor a large React form component with too many conditional rendering props?

Refactor a large React form component by applying composition patterns to break it down into smaller, reusable pieces. Use shared context to handle state management, replacing unwieldy conditional rendering props with explicit component variants for enhanced clarity.

Can I use React 19 APIs like use() and simplified ref handling with these composition patterns?

Yes, these React composition patterns adopt modern React 19 practices. You can leverage new API features like the use() hook and simplified ref handling to build scalable and maintainable components with enhanced code clarity.

What's the best way to design a reusable React component library without prop drilling?

The best way to design a reusable React component library is using compound components and context providers. This composition technique manages state effectively without prop drilling, creating flexible and scalable structures for various UI requirements.