vercel-composition-patterns

Guide React composition patterns with compound components and context providers.

947|163|Updated Jan 13, 2026
One-click install
npx skills add https://github.com/guanyang/antigravity-skills --skill vercel-composition-patterns-guanyang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/guanyang/antigravity-skills/tree/main/skills/composition-patterns
Command: npx skills add https://github.com/guanyang/antigravity-skills --skill vercel-composition-patterns-guanyang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexity of managing React components by providing patterns to avoid prop proliferation and build more maintainable, flexible, and scalable UIs.

Core Features & Use Cases

  • Component Architecture: Learn to avoid boolean prop proliferation and structure components using compound components with shared context.
  • State Management: Discover how to lift state into provider components and decouple state management from UI logic.
  • Implementation Patterns: Prefer composing children over render props and create explicit component variants for clarity.
  • React 19 APIs: Understand the new use() hook and ref handling in React 19.
  • Use Case: Refactor a large, monolithic Composer component with numerous boolean props into a set of explicit, composable components like ThreadComposer and EditMessageComposer.

Quick Start

Review the rules for component architecture to understand how to avoid boolean prop proliferation in your React 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 avoid boolean prop proliferation in React components?

You can avoid boolean prop proliferation by adopting explicit component variants and compound components. This pattern structures scalable React UIs by replacing conditional flags with distinct, composable components, resulting in more maintainable and flexible architectures.

What is the best way to manage state in scalable React components?

Managing state in scalable React components is best achieved by lifting state into provider components and utilizing context providers. This decouples state management from UI logic, allowing compound components to share state efficiently without excessive prop drilling.

How do I refactor a monolithic React component into composable parts?

Refactoring a monolithic React component involves breaking it down into explicit, composable variants like ThreadComposer and EditMessageComposer. You use compound components with shared context to replace large conditional blocks, composing children directly over render props for clarity.

Does React 19 change how hooks and refs work in component composition?

React 19 changes component composition by introducing the use() hook for reading context and modifying ref handling. These APIs require updating your composition patterns to properly manage state and component references in scalable architectures.

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

Use compound components instead of render props in React when you need clearer component architecture and explicit variants. Composing children directly is preferred over render props to enhance maintainability and avoid prop proliferation.

Can I use TypeScript with React compound components and context providers?

You can use TypeScript with React compound components and context providers. TypeScript enforces type safety across your component architecture, ensuring that state managed within context providers is correctly typed when passed through composable children.