vercel-composition-patterns

Refactor React components using composition patterns like compound components and context providers.

Updated Mar 28, 2026
One-click install
npx skills add https://github.com/baselakkad585-maker/basel-dev-skills --skill vercel-composition-patterns-baselakkad585-maker
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/baselakkad585-maker/basel-dev-skills/tree/main/skills/composition-patterns
Command: npx skills add https://github.com/baselakkad585-maker/basel-dev-skills --skill vercel-composition-patterns-baselakkad585-maker

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React composition patterns scale the way teams build UI, reducing boolean-prop proliferation and enabling reusable APIs. Use when refactoring components, building flexible component libraries, or designing APIs that compose via compound components, render props, or context providers. Includes React 19 API changes.

Core Features & Use Cases

  • Avoid boolean-prop proliferation by using composition rather than multiple boolean flags.
  • Support compound components, lifting state, and shared context to create flexible APIs.
  • Use cases include building scalable component libraries, design systems, and migrating large UIs to composition-based architectures.

Quick Start

Refactor a sample component library by replacing boolean props with composition and context providers to achieve scalable APIs.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I refactor React components to avoid boolean prop proliferation?

Compound components in React create flexible APIs by grouping related sub-components together, allowing state sharing via context providers without boolean prop proliferation, resulting in highly reusable component libraries.

What is the best way to build a scalable React component library?

Use React composition patterns when refactoring large UIs, building flexible component libraries, or designing design systems that require shared context and compound components to avoid boolean prop proliferation.

Does this React composition approach work with React 19 APIs?

Yes, this composition approach fully supports React 19 APIs. It enforces clear architecture guidelines and component-level encapsulation to build scalable UIs compatible with React 19 context providers.

How do render props improve React component architecture?

Render props improve React component architecture by passing a function as a prop to share state and logic, creating flexible APIs that avoid boolean prop proliferation and enhance component-level encapsulation.