vercel-composition-patterns

Guide React engineers to replace boolean props with composition patterns.

Updated May 5, 2026
One-click install
npx skills add https://github.com/Matrix-The-One/agent-test-2 --skill vercel-composition-patterns-matrix-the-one
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/Matrix-The-One/agent-test-2/tree/main/.claude/skills/vercel-composition-patterns
Command: npx skills add https://github.com/Matrix-The-One/agent-test-2 --skill vercel-composition-patterns-matrix-the-one

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides structured guidance for building scalable React component libraries by avoiding boolean prop proliferation through composition, compound components, and context-driven patterns.

Core Features & Use Cases

  • Compound components with shared context to reduce prop drilling and enable flexible composition across UI;
  • State lifting via providers to share UI state with siblings and external components;
  • Explicit variant components (e.g., ThreadComposer, EditMessageComposer) instead of monolithic boolean-mode components;
  • React 19 API guidance including use() for context and treating refs as regular props;
  • Design-system alignment for architecture, state, and implementation patterns across teams.

Quick Start

Build a ThreadComposer variant using a dedicated provider and the composite components to illustrate explicit pattern usage.

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?

Avoid boolean prop proliferation in React by applying composition patterns, replacing monolithic components with explicit variant components and compound components driven by shared context.

What is the best way to structure scalable React component libraries?

Scable React component libraries are structured using composition patterns, aligning architecture, state, and implementation through compound components, context providers, and explicit variants.

How do compound components and context providers reduce prop drilling?

Compound components and context providers reduce prop drilling by lifting UI state into a shared provider, enabling flexible composition and sibling component access without passing props deeply.

Does React 19 introduce new APIs for component composition and context?

React 19 provides guidance for component composition, including using the use() API for context consumption and treating refs as regular props to streamline state management.

When should I use explicit variant components instead of boolean modes?

Use explicit variant components instead of boolean-mode components when building scalable React libraries to prevent monolithic structures and ensure clear, maintainable design-system alignment.

Can I use these composition patterns for refactoring existing design systems?

Yes, these React composition patterns actively support refactoring existing design systems by defining best-practice architecture, explicit variants, and provider-based state management.