vercel-composition-patterns

Guide React composition patterns for scalable component libraries with React 19 API changes.

Updated Feb 21, 2026
One-click install
npx skills add https://github.com/mikeyfennelly1/hackeurope--210226 --skill vercel-composition-patterns-mikeyfennelly1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/mikeyfennelly1/hackeurope--210226/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/mikeyfennelly1/hackeurope--210226 --skill vercel-composition-patterns-mikeyfennelly1

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the complexity of building maintainable and scalable React components by providing patterns to avoid prop proliferation and improve code organization.

Core Features & Use Cases

  • Component Architecture: Guides on structuring components to avoid boolean prop issues and leverage compound components.
  • State Management: Strategies for lifting state, defining context interfaces, and decoupling state implementation from UI.
  • Implementation Patterns: Best practices for creating explicit component variants and preferring children over render props.
  • Use Case: Refactor a large, monolithic Card component with numerous boolean props into smaller, composable components like Card.Header, Card.Body, and Card.Footer, each managing its own state or consuming context effectively.

Quick Start

Apply the 'architecture-avoid-boolean-props' rule to refactor the provided monolithic component.

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?

Avoid boolean prop proliferation in React components by applying the architecture-avoid-boolean-props rule to refactor monolithic structures into smaller, composable elements like Card.Header and Card.Body, utilizing compound components and children composition to improve code organization.

What is the best way to manage state in compound components using the React context API?

Manage state in compound components by defining context interfaces, lifting state to context providers, and decoupling state implementation from UI, ensuring scalable React component architecture without prop drilling.

Should I use render props or children composition for React component architecture?

Prefer children composition over render props for React component architecture. Children composition provides clearer code organization and avoids the callback complexity often associated with render props in component libraries.

Does React 19 change how refs and context are handled in component libraries?

Yes, React 19 introduces specific API changes for refs and context. When building component libraries, review these updates to ensure your compound components and context providers remain compatible and maintainable.

When should I refactor a monolithic React component into compound components?

Refactor a monolithic React component into compound components when it accumulates numerous boolean props, making it hard to maintain. Splitting into composable parts like Card.Header and Card.Footer restores scalability.