vercel-composition-patterns

Guide React component architecture with compound components and explicit variants.

Updated Dec 4, 2025
One-click install
npx skills add https://github.com/hiroto0701/dotfiles --skill vercel-composition-patterns-hiroto0701
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/hiroto0701/dotfiles/tree/main/private_dot_claude/skills/vercel-composition-patterns
Command: npx skills add https://github.com/hiroto0701/dotfiles --skill vercel-composition-patterns-hiroto0701

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to advanced React composition patterns, helping developers avoid common pitfalls like boolean prop proliferation and create more flexible, maintainable, and scalable component architectures.

Core Features & Use Cases

  • Component Architecture: Learn to structure components using compound components and avoid excessive boolean props.
  • State Management: Understand how to lift state into providers and decouple state logic from UI components.
  • Implementation Patterns: Discover best practices like preferring children over render props and creating explicit component variants.
  • React 19 APIs: Stay updated with new APIs like use() and simplified ref handling.
  • Use Case: Refactor a complex Card component that currently uses numerous boolean props (e.g., isHoverable, isDraggable, isSelectable) into a set of well-defined, composable sub-components that achieve the same functionality with greater clarity and flexibility.

Quick Start

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

To avoid boolean prop proliferation in React components, refactor to use compound components. This pattern breaks down complex UI elements into composable sub-components, replacing numerous boolean flags like isHoverable with explicit, flexible component variants.

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

The best way to decouple state management from React UI components is lifting state into providers. This separates state logic from rendering, ensuring components remain scalable and maintainable without being tightly coupled to specific state implementations.

How do compound components improve React component architecture?

Compound components improve React component architecture by allowing flexible composition without excessive props. They enable developers to build scalable, maintainable components by combining sub-components explicitly rather than relying on complex boolean logic.

Does this guide cover React 19 API changes for refs and context?

Yes, this guide covers React 19 API changes for refs and context. It provides updated implementation patterns utilizing new APIs like use() and simplified ref handling to ensure your component architecture adheres to modern standards.

When should I use children instead of render props in React?

You should prefer children over render props in React to create more maintainable component architectures. Using children provides a cleaner, more standard composition pattern that avoids complex render prop callbacks and improves readability.

How do I refactor a complex React Card component with multiple boolean props?

To refactor a complex React Card component with multiple boolean props, apply composition patterns by splitting it into well-defined, composable sub-components. This achieves the same functionality with greater clarity and flexibility without relying on boolean flags.