vercel-composition-patterns

Create explicit React component variants with shared context providers.

1|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/mahou-labs/shiru --skill vercel-composition-patterns-mahou-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/mahou-labs/shiru/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/mahou-labs/shiru --skill vercel-composition-patterns-mahou-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Boolean prop proliferation in React components leads to combinatorial variants and hard-to-maintain code. This Skill promotes explicit variant components and a shared context to simplify APIs.

Core Features & Use Cases

  • Explicit variants like ThreadComposer, EditMessageComposer, ForwardMessageComposer that share internal logic via a provider.
  • Use of compound components and lifted state to reduce prop drilling.
  • Flexible architecture patterns for scalable component libraries and design systems.

Quick Start

Create three explicit variants (ThreadComposer, EditMessageComposer, ForwardMessageComposer) that wire a provider around the UI to demonstrate reusable, explicit composition.

Frequently Asked Questions about vercel-composition-patterns

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

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

Prevent boolean prop proliferation in React components by creating explicit variant components that share internal logic via a provider, replacing combinatorial boolean flags with scalable composition patterns.

What is the best way to build scalable UI variants in a React design system?

Scalable UI variants in a React design system are built using explicit variant components like ThreadComposer and EditMessageComposer, sharing state through generic context interfaces to reduce prop drilling.

How do compound components reduce prop drilling in React?

Compound components reduce prop drilling in React by lifting state into a provider-based context, allowing nested UI elements to access shared state and actions without receiving redundant props.

Can I use React 19 API practices for component composition?

Yes, this composition pattern supports React 19 API practices by structuring generic context interfaces for state, actions, and meta around explicit variant components and provider-based state lifting.

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

Use explicit variant components instead of boolean props when your React component library requires scalable UI variations, as boolean combinations create hard-to-maintain code and complex APIs.