vercel-composition-patterns

Refactor React components with boolean props into explicit variant and compound components.

Updated Feb 17, 2026
One-click install
npx skills add https://github.com/aidanaden/sg-food-guide --skill vercel-composition-patterns-aidanaden
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/aidanaden/sg-food-guide/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/aidanaden/sg-food-guide --skill vercel-composition-patterns-aidanaden

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Addresses the complexity of boolean prop proliferation in React components by promoting explicit variants and compound components.

Core Features & Use Cases

  • Explicit variant components for predictable rendering
  • Compound components with shared context to avoid prop drilling
  • Provider-based state lifting enabling UI reuse across apps

Quick Start

Identify a component that relies on many boolean props and refactor it into explicit variant components backed by a 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 refactor React components with too many boolean props?

Refactor React components with excessive boolean props by replacing them with explicit variant components backed by a shared provider. This compound component architecture lifts state via context, avoiding prop drilling and ensuring predictable rendering across large applications.

What is boolean prop proliferation in React and why is it a problem?

Boolean prop proliferation in React occurs when components accept numerous boolean flags to control rendering, leading to unmanageable combinations and unpredictable UI states. Replacing them with explicit variant components ensures predictable rendering across large applications and design systems.

How do compound components share state in React without prop drilling?

Compound components share state in React without prop drilling by using a generic context interface and a provider to lift state. This architecture enables UI reuse across apps while keeping the consumer API clean and explicitly defined.

Can I use these React composition patterns for component libraries and design systems?

Yes, you can use these React composition patterns for component libraries and design systems. The architecture enforces explicit variants and provider-based state lifting to satisfy strict scalability, architecture, and UI reusability requirements.

When should I replace boolean props with explicit variant components in React?

You should replace boolean props with explicit variant components in React when a single component relies on multiple boolean flags to control rendering. This architectural shift enforces a generic context interface and provider-based state lifting to satisfy scalability and reusability requirements.