vercel-composition-patterns

Refactor React components using composition patterns to reduce boolean props.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React codebases often suffer from boolean prop proliferation that leads to tangled, hard-to-maintain components. This guide provides composition-based patterns to create scalable, reusable component libraries.

Core Features & Use Cases

  • Explicit variant components replace boolean props with clear, self-descriptive APIs.
  • Compound components with shared context enable flexible composition and reduce prop drilling.
  • Provider-based state lifting and generic context interfaces support multiple UI implementations.

Quick Start

Start by replacing boolean flag props with explicit variant components and wrap your UI with a simple Provider to share state and actions across 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 reduce boolean prop proliferation in React components?

Use composition patterns like explicit variant components to replace boolean props. This approach refactors tangled conditional logic into clear, self-describing APIs for scalable React architecture.

What is the best way to share state across React components without prop drilling?

Use compound components with shared context and provider-based state lifting. This composition pattern eliminates prop drilling by distributing generic context interfaces across your React UI.

How do I implement render props and compound components in TypeScript?

Define generic context interfaces and explicit variant components. This TypeScript architecture supports flexible UI implementations while applying render props and compound component patterns.

Does this React composition guidance support React 19 API usage?

Yes, the guidance covers React 19 API usage for context providers and state lifting. It applies modern composition techniques to ensure your component architecture scales with current React features.

When should I use explicit variant components over boolean flags in React?

Use explicit variant components when your UI logic becomes tangled with multiple conditional states. This pattern prevents boolean prop proliferation and maintains scalable, reusable React component libraries.