vercel-composition-patterns

Guide React component architecture with compound components and React 19 APIs.

1|Updated Oct 22, 2025
One-click install
npx skills add https://github.com/vojtechmares/mares.cz --skill vercel-composition-patterns-vojtechmares
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/vojtechmares/mares.cz/tree/main/.claude/skills/vercel-composition-patterns
Command: npx skills add https://github.com/vojtechmares/mares.cz --skill vercel-composition-patterns-vojtechmares

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexity of building and maintaining React components, particularly those suffering from prop proliferation and difficult composition.

Core Features & Use Cases

  • Component Architecture: Guides on avoiding boolean prop issues and leveraging compound components for better structure.
  • State Management: Strategies for decoupling state logic, defining generic context interfaces, and lifting state effectively.
  • Implementation Patterns: Best practices for creating explicit component variants and preferring children over render props.
  • React 19 APIs: Updates on new APIs like use() and handling refs.
  • Use Case: Refactor a large, monolithic Modal component with numerous boolean props into a set of smaller, composable components that can be assembled flexibly.

Quick Start

Apply the vercel-composition-patterns skill to refactor the Composer component to use compound components and avoid boolean 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 refactor a monolithic React component to avoid boolean prop proliferation?

Refactor monolithic React components into smaller, composable compound components to avoid boolean prop proliferation. This pattern decouples state management and allows flexible assembly of complex UIs without relying on confusing boolean flags.

What is the best way to decouple state management in complex React component architectures?

Decouple state management in React component architectures by defining generic context interfaces and lifting state effectively. This approach isolates state logic from the UI layer, making complex components easier to maintain and scale.

How do compound components improve React component architecture?

Compound components improve React component architecture by breaking down large UI elements into smaller, composable parts. This structure prevents prop drilling, avoids boolean prop issues, and leverages context-based state sharing for flexible composition.

Can I use React 19 APIs to handle refs and state in compound components?

Yes, you can leverage React 19 APIs like the use() hook to handle refs and state in compound components. These APIs facilitate context-based state sharing and simplify state management decoupling in scalable architectures.

When should I prefer children over render props in React composition patterns?

Prefer children over render props in React composition patterns to create explicit component variants and improve readability. This approach simplifies component composition and reduces the complexity of prop management in scalable UIs.

Does this React composition pattern work for fixing components with too many props?

Yes, these React composition patterns work for fixing components with too many props by replacing them with explicit variants and smaller compound components. This solves difficult composition challenges and eliminates prop proliferation.