vercel-composition-patterns

Standardize React component architectures to reduce boolean prop proliferation.

6|2|Updated Jan 25, 2026
One-click install
npx skills add https://github.com/PaulRBerg/dot-agents --skill vercel-composition-patterns-paulrberg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/PaulRBerg/dot-agents/tree/main/skills/vercel-composition-patterns
Command: npx skills add https://github.com/PaulRBerg/dot-agents --skill vercel-composition-patterns-paulrberg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Designing scalable React component libraries often suffers from boolean prop proliferation and tangled conditional logic. This Skill provides a structured approach using explicit variant components, compound components, and provider-based state management to keep UI logic clean and maintainable.

Core Features & Use Cases

  • Explicit Variants: Create dedicated variant components (e.g., ThreadComposer, EditMessageComposer) that communicate intent clearly and reduce feature toggles.
  • Compound Components: Build reusable UI pieces that share state via a context, avoiding prop drilling.
  • Provider-based State Management: Lift state into providers so UI components can be composed in flexible layouts and reused across different state sources.
  • React 19 API Alignment: Embrace use() for context and regular ref props to stay current with React 19 guidelines.

Quick Start

Use this skill to refactor a React component library to remove boolean props and adopt explicit, reusable composition patterns.

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 components by replacing conditional logic with explicit variant components like ThreadComposer or EditMessageComposer, which clearly communicate UI intent and eliminate tangled feature toggles.

What is the best way to share state across React UI components without prop drilling?

Share state across React UI components without prop drilling by using compound components with shared context, lifting state into providers so UI pieces can be composed in flexible layouts and reused across different state sources.

How do I refactor a React component library to use explicit variant components?

Refactor a React component library to use explicit variant components by identifying boolean-driven UI variations and extracting them into dedicated, self-contained components that standardize architecture and reduce tangled conditional logic.

Does this React composition pattern support the React 19 API?

Yes, this React composition pattern aligns with React 19 API best practices by embracing the use() hook for context and regular ref props, ensuring your component architecture stays current with React 19 guidelines.

When should I use compound components in React?

Use compound components in React when building reusable UI pieces that need to share state via context, allowing you to avoid prop drilling and maintain clean, maintainable UI logic across flexible layouts.