vercel-composition-patterns

Identify and apply React composition patterns to reduce boolean prop proliferation.

1|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/otography/otography-app --skill vercel-composition-patterns-otography
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/otography/otography-app/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/otography/otography-app --skill vercel-composition-patterns-otography

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React component libraries often suffer from boolean prop proliferation, making variants hard to reason about and maintain. This skill provides a set of patterns to create scalable, reusable APIs.

Core Features & Use Cases

  • Compound components with shared context to avoid prop drilling.
  • Lifted state through provider components to enable UI reuse with multiple state strategies.
  • Explicit variants for clear, self-documenting usage, including thread, edit, and forward patterns.
  • React 19 API guidance for modern context usage and ref handling.

Quick Start

Replace boolean props with dedicated variant components and connect them to a shared provider to enable cross-cutting UI reuse.

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?

Reduce boolean prop proliferation in React by replacing conditional flags with explicit variant components and connecting them to a shared context provider. This separates UI from state management and creates scalable, self-documenting component APIs.

What is the best way to avoid prop drilling in a scalable React component library?

The best way to avoid prop drilling in a scalable React component library is implementing compound components with shared context. This pattern lifts state through provider components, enabling cross-cutting UI reuse without passing props down manually.

How do React 19 API changes affect context providers and ref handling?

React 19 API changes modernize context usage and ref handling, allowing you to build generic context interfaces and provider-based state lifting more efficiently. This updates how you structure compound components and forward refs within your architecture.

When should I use compound components instead of render props in React?

Use compound components instead of render props when you need to connect shared UI elements to a generic context interface for cross-cutting reuse. Render props suit highly dynamic render logic, while compound components provide clearer, self-documenting APIs for explicit variants.

Can I separate UI rendering from state management using React composition patterns?

Yes, you can separate UI rendering from state management using React composition patterns by lifting state through provider components. This architecture enables UI reuse with multiple state strategies, making your component library variants easier to reason about and maintain.