vercel-composition-patterns

Standardize React component APIs with variant components, compound components, and context providers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide consolidates React composition practices to replace bloated boolean props with explicit, reusable patterns, making component APIs easier to reason about and maintain.

Core Features & Use Cases

  • Explicit variant components (e.g., ThreadComposer, EditMessageComposer) to remove complex prop combinations.
  • Compound components with a shared context that enables flexible composition and reduces prop drilling.
  • State lifting into providers so UI remains UI without knowledge of the underlying state management, and different providers can swap in without UI changes.

Quick Start

Instantiate an explicit variant such as ThreadComposer with a channelId to observe shared state across providers.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I scale React components without boolean prop proliferation?

To scale React components, replace bloated boolean props with explicit variant components like ThreadComposer, which removes complex prop combinations and makes component APIs easier to maintain.

What is the best way to structure compound components in React to reduce prop drilling?

Compound components in React use a shared context to enable flexible composition, which reduces prop drilling and allows state to be lifted into providers so the UI remains unaware of underlying state management.

How do I adapt React context providers for the React 19 API?

Adapt React context providers for React 19 by applying generic context interfaces and lifting state into providers, which allows different providers to swap in without requiring UI changes.

Can I refactor an existing React component to use explicit variant components?

Yes, you can refactor React components by replacing complex boolean prop combinations with explicit, reusable variant components, making the component APIs easier to reason about and maintain.

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

Explicit variant components are preferred to remove complex prop combinations, but render props are also addressed as a composition pattern when your React component requires more dynamic rendering control.