vercel-composition-patterns

Refactor React components with boolean props into compound components and context providers.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/eryckassis/Dior-Luxury-Boutique-Saas --skill vercel-composition-patterns-eryckassis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/eryckassis/Dior-Luxury-Boutique-Saas/tree/main/.claude/vercel-composition-patterns
Command: npx skills add https://github.com/eryckassis/Dior-Luxury-Boutique-Saas --skill vercel-composition-patterns-eryckassis

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React projects often suffer from boolean prop proliferation that creates hard-to-maintain conditional rendering. This skill provides a structured approach to building scalable, reusable UI by promoting composition patterns such as compound components, explicit variants, and provider-based state management.

Core Features & Use Cases

  • Explicit Variants: Replace complex boolean props with clearly named variant components (e.g., ThreadComposer, EditMessageComposer, ForwardMessageComposer).
  • Compound Components with Context: Break large components into small, context-driven pieces that can be composed without prop drilling.
  • Provider-Based State Management: Lift state into providers to enable sharing across non-nested UI parts and multiple UI footprints.
  • React 19 API Guidance: Apply the updated API usage (use() instead of useContext, ref as regular prop) for modern React apps.

Quick Start

Refactor a monolithic component with multiple boolean props into explicit variant components or a set of compound components using a shared provider.

Frequently Asked Questions about vercel-composition-patterns

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

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

To avoid boolean prop proliferation in React, replace complex conditional rendering with explicit variant components like ThreadComposer or EditMessageComposer. This structured approach builds scalable, reusable UI by using clearly named component variants instead of multiple boolean flags.

What is the best way to refactor a monolithic React component into compound components?

Refactoring a monolithic React component into compound components involves breaking it into small, context-driven pieces using provider-based state management. This allows composing UI elements together without prop drilling, lifting state into providers to enable sharing across non-nested UI parts.

Does this React composition pattern approach work with React 19 API changes?

Yes, these React composition patterns work with React 19 API changes by applying updated usage guidance. The approach specifically implements using the use() hook instead of useContext and treats ref as a regular prop to align with modern React 19 application development.

When should I use provider-based state management over prop drilling in React?

You should use provider-based state management in React when you need to share state across non-nested UI parts or multiple UI footprints. It eliminates prop drilling by lifting state into context providers, enabling flexible composition of compound components.

Why does using boolean props for component variants create maintenance issues?

Using boolean props for component variants creates maintenance issues because it forces complex conditional rendering logic within a single component. Replacing them with explicit variant components provides a structured approach to building scalable, reusable UI without hard-to-maintain conditional checks.