vercel-composition-patterns

Guide React component composition with compound components and provider state.

Updated Mar 10, 2026
One-click install
npx skills add https://github.com/dotlab-hq/medisync --skill vercel-composition-patterns-dotlab-hq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/dotlab-hq/medisync/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/dotlab-hq/medisync --skill vercel-composition-patterns-dotlab-hq

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and 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 create more maintainable, flexible codebases.

Core Features & Use Cases

  • Component Architecture: Avoids boolean prop overload by promoting composition and compound components.
  • State Management: Guides on lifting state into providers for better sharing and decoupling state logic from UI.
  • Implementation Patterns: Offers best practices like preferring children over render props and creating explicit component variants.
  • Use Case: Refactor a large component with many conditional rendering paths into smaller, composable pieces that are easier to understand and extend.

Quick Start

Apply the 'avoid boolean prop proliferation' pattern to the Composer component.

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 using composition patterns and compound components to replace conditional rendering paths with smaller, composable pieces. This approach prevents prop overload and creates more maintainable, flexible component architectures.

What is the best way to share state across multiple React components?

The best way to share state across React components is lifting state into providers. By decoupling state logic from the UI and defining generic context interfaces, you can share data efficiently across your component tree without excessive prop drilling.

How do compound components work in React?

Compound components in React work by combining smaller, composable pieces to build complex UIs without boolean prop overload. This pattern leverages children over render props, allowing explicit component variants to manage their own shared state via context providers.

Does this React composition pattern support React 19 API changes for refs and context?

Yes, these React composition patterns address React 19 API changes for refs and context. The guidelines ensure your component architecture, state management, and generic context interfaces remain compatible with the latest React 19 updates.

When should I refactor a React component using composition patterns?

Refactor a React component using composition patterns when it grows large with many conditional rendering paths. Splitting it into smaller, composable pieces using compound components and providers makes the codebase easier to understand, maintain, and extend.