vercel-composition-patterns

Refactor React component libraries by replacing boolean props with explicit variants and compound components.

2|Updated Oct 13, 2025
One-click install
npx skills add https://github.com/Max-Loo/multi-chat --skill vercel-composition-patterns-max-loo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/Max-Loo/multi-chat/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/Max-Loo/multi-chat --skill vercel-composition-patterns-max-loo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React codebases often suffer from boolean prop proliferation and brittle refactors. This Skill provides composition patterns to build scalable component libraries.

Core Features & Use Cases

  • Use compound components to share state without prop drilling.
  • Replace boolean flags with explicit variants for clarity.
  • Apply context providers to enable state and behavior reuse across UI.

Quick Start

Apply these patterns to refactor a component library today by replacing boolean props with explicit variants and compound components.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I stop prop drilling in my React component library?

To stop prop drilling in React, apply compound components and context providers to share state implicitly across the UI tree. This pattern establishes separate provider boundaries, enabling state and behavior reuse without passing props manually down every layer.

What is the best way to refactor React components with too many boolean props?

The best way to refactor React components with boolean props is replacing them with explicit variants. This composition pattern removes boolean prop proliferation, creating safer and more maintainable component APIs that scale without brittle conditional rendering logic.

How do compound components work in React?

Compound components in React work by grouping multiple components together to share implicit state without prop drilling. They use context providers as separate boundaries, allowing individual child components to manage and access shared state while maintaining a clean, reusable UI API.

How do I design a scalable React component architecture?

Design scalable React component architecture by applying explicit variants, compound components, context providers, and dependency-injected UI. This structure removes boolean prop proliferation and enables safer, more maintainable composition across large React projects.

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

Use render props instead of compound components in React when you need explicit control over the rendering logic. Both patterns enable safer composition without prop drilling, but render props allow you to inject and customize UI rendering directly within your component architecture.

Can I apply these React composition patterns to an existing project?

Yes, you can apply these React composition patterns to refactor existing component systems. Replace boolean flags with explicit variants and adopt compound components with separate provider boundaries to safely scale and maintain your current UI libraries.