vercel-composition-patterns

Refactor React components into explicit variants and compound components.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps teams refactor React components to reduce boolean prop proliferation and create reusable APIs using composition patterns like compound components, lifting state, and context providers.

Core Features & Use Cases

  • Explicit variant components (for example, ThreadComposer, EditMessageComposer) to replace multi-flag components.
  • Compound components with a shared context to avoid prop drilling and enable flexible assembly.
  • State lifting into providers to decouple UI from data management and support cross-component access.
  • Guidance includes patterns for render props, context interfaces, and modern React 19 APIs.

Quick Start

Refactor a UI library by replacing boolean props with explicit variant components and 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 reduce boolean prop proliferation in React components?

To reduce boolean prop proliferation in React components, refactor multi-flag components into explicit variant components like ThreadComposer or EditMessageComposer, creating reusable APIs that avoid conditional rendering complexity.

What are compound components in React and how do they work?

Compound components in React are a composition pattern using a shared context to avoid prop drilling, enabling flexible assembly of related UI parts while maintaining internal state communication between parent and child components.

Does this React composition pattern guidance support React 19 APIs?

Yes, this React composition pattern guidance supports React 19 APIs, including adapting to the use() hook over useContext and implementing provider-based state lifting for modern context consumption.

What's the best way to decouple UI from state management in a React component library?

The best way to decouple UI from state management in a React component library is lifting state into context providers, allowing cross-component access without prop drilling and separating data logic from rendering.

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

You should use explicit variant components instead of boolean props in React when a component handles multiple distinct UI states, preventing complex conditional logic and making the component API cleaner and more maintainable.