vercel-composition-patterns

Refactor React components by replacing boolean props with composition patterns.

1|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/paialex/ai-skills-bank --skill vercel-composition-patterns-paialex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/paialex/ai-skills-bank/tree/main/skills/composition-patterns
Command: npx skills add https://github.com/paialex/ai-skills-bank --skill vercel-composition-patterns-paialex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React projects accumulate boolean prop proliferation, nested render logic, and brittle UI variants. This Skill provides a structured approach to refactor components via composition patterns, enabling reusable APIs and scalable architectures.

Core Features & Use Cases

  • Use compound components, lifting state, and explicit variants to design scalable, maintainable component libraries.
  • Reuse UI fragments across apps with contextual providers and dependency-injected state.
  • Apply patterns for component architecture, state management, and adaptation to React 19 APIs in teams shipping robust UI systems.

Quick Start

Refactor a target React component by replacing boolean props with explicit variant components and a provider to share state and behavior.

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?

Reduce boolean prop proliferation in React by replacing conditional rendering with explicit variant components, using compound components and shared context to separate concerns and flatten nested logic.

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

Build a scalable React UI library API by applying composition patterns: define explicit variants, use compound components for structural flexibility, and lift shared state into contextual providers to avoid brittle configurations.

How do compound components share state in React without prop drilling?

Compound components share state in React by leveraging contextual providers, allowing parent and child components to communicate implicitly without passing props down manually through every layer of the component tree.

Does React 19 change how context and refs are handled in composition patterns?

React 19 changes composition patterns by introducing the use() API for context consumption instead of useContext and removing the need for forwardRef in modern code, simplifying how components manage shared state and DOM references.

How do I refactor a React component to use explicit variants instead of boolean props?

Refactor a React component by identifying boolean-driven conditional branches, extracting them into distinct variant components, and orchestrating them through a provider to share behavior and state cleanly.

When should I use composition patterns over conditional rendering in React?

Use composition patterns over conditional rendering when components accumulate multiple boolean props, suffer from brittle variant combinations, or require flexible reusable APIs that scale across different application contexts.