vercel-composition-patterns

Refactor React components using composition patterns to replace boolean props with explicit variants.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React composition patterns help reduce boolean prop proliferation and unlock scalable, reusable UI APIs across large component libraries.

Core Features & Use Cases

  • Encapsulates patterns like compound components, render props, and context providers to simplify complex UIs.
  • Encourages explicit variants to replace boolean mode booleans, improving maintainability.
  • Applies to teams migrating to React 19 API changes and building reusable design systems.

Quick Start

Refactor a boolean-driven component by implementing explicit variant components using a provider-based architecture to enable scalable, reusable UI.

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?

React composition patterns reduce boolean prop proliferation by replacing conditional booleans with explicit variant components. This approach uses a provider-based architecture to encapsulate logic, improving API maintainability and scalability across large component libraries.

What are compound components and how do they create reusable React APIs?

Compound components are a React composition pattern where a parent provider shares implicit state with children, creating flexible and reusable React APIs. This encapsulation prevents prop drilling and simplifies complex component interactions.

How do I refactor a React component to use context providers and render props?

Refactor a React component by lifting state into a context provider and exposing generic interfaces for state, actions, and meta. You can then pass behavior down using render props, ensuring explicit variants replace boolean-driven rendering logic.

Does this React composition approach work for teams migrating to React 19?

Yes, this approach applies to teams migrating to React 19 API changes. It guides the implementation of explicit variants, generic context interfaces, and provider-based state lifting to build scalable design systems compatible with React 19.

When should I use explicit variants instead of boolean props in a component library?

You should use explicit variants instead of boolean props when building scalable component libraries to avoid conflicting mode combinations. Explicit variants enforce predictable component behavior, making APIs easier to maintain and refactor safely.