vercel-composition-patterns

Refactor React components to reduce boolean props with compound components and context providers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Refactoring React components to reduce boolean prop proliferation and to build scalable, reusable APIs.

Core Features & Use Cases

  • Encourages using compound components, lifting state into providers, and composing internals.
  • Covers render props, context providers, and explicit component architecture for maintainable codebases.
  • Includes guidance on React 19 API changes and migration considerations.

Quick Start

Begin by adopting explicit variant components (ThreadComposer, EditMessageComposer, ForwardMessageComposer) and implement a provider-based pattern to decouple state from UI.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I reduce boolean prop proliferation in React components?

Compound components in React decouple UI structure from state management by allowing parent components to implicitly share state with children via context providers. This pattern enables flexible component composition without prop drilling, creating scalable and reusable UI library APIs.

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

The best way to decouple state from UI in React is implementing a provider-based pattern to lift state management into context providers. This architecture separates state logic from presentation components, enabling independent rendering and easier maintenance of complex user interfaces.

How do I use render props and context providers for React UI libraries?

Render props and context providers scale React UI libraries by passing rendering logic through functions and sharing state across deeply nested components. Combining these patterns creates generic context interfaces that decouple internal component behavior from external API surface design.

Are there React 19 API changes affecting context provider patterns?

React 19 introduces API changes affecting context provider patterns, requiring migration considerations for existing component architectures. Updating generic context interfaces and provider-based state lifting ensures compatibility with the latest React composition and rendering paradigms.

When should I not use compound components in React?

Avoid compound components in React when component hierarchy is strictly static or when explicit variant components provide sufficient clarity. If state lifting into providers introduces unnecessary abstraction overhead for simple UI elements, standard prop passing remains more appropriate.