vercel-composition-patterns

Codify React composition patterns using compound components and shared context.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide codifies React composition patterns to reduce boolean prop proliferation by using compound components, lifting state, and shared context.

Core Features & Use Cases

  • Encourages explicit variant components (ThreadComposer, EditMessageComposer, ForwardMessageComposer) over boolean prop combinations.
  • Promotes compound components and shared context to avoid prop drilling.
  • Provides guidance for decoupling UI from state via providers and generic context interfaces for flexible reuse across different state implementations.

Quick Start

Integrate explicit variants and providers into a React project by extracting a ThreadComposer and a ChannelProvider that share state.

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?

To reduce boolean prop proliferation in React components, replace conditional flags with explicit variant components like ThreadComposer or EditMessageComposer. This pattern enforces clear APIs and avoids complex rendering logic across your UI library.

What is the best way to scale React apps with composable patterns?

The best way to scale React apps is by using compound components, lifting state, and shared context. These React composition patterns decouple UI from state implementation, allowing flexible reuse across different context providers and render props.

How do I avoid prop drilling in a React design system?

Avoid prop drilling in a React design system by applying compound components and shared context. Generic context interfaces for state, actions, and meta allow you to pass data directly to child components without intermediate props.

Can I use React 19 conventions with shared context providers?

Yes, you can use React 19 conventions with shared context providers by implementing the use() hook and passing regular props for refs. This approach decouples UI from state and supports flexible APIs across component variants.

When should I use render props over compound components in React?

Use render props in React when you need to share rendering logic explicitly between components, whereas compound components are better for building encapsulated UI libraries. Both patterns reduce boolean prop combinations and enable flexible reuse.