vercel-composition-patterns

Refactor React components to replace boolean props with composition patterns.

3|Updated Jan 1, 2026
One-click install
npx skills add https://github.com/huynhanx03/GoLink --skill vercel-composition-patterns-huynhanx03
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/huynhanx03/GoLink/tree/main/website/.agent/skills/composition-patterns
Command: npx skills add https://github.com/huynhanx03/GoLink --skill vercel-composition-patterns-huynhanx03

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide helps engineering teams avoid boolean prop proliferation by promoting React composition patterns, enabling flexible, scalable component libraries, and reusable APIs. It also covers refactoring strategies around compound components, render props, and context providers, including guidance for React 19 API changes.

Core Features & Use Cases

  • Avoid Boolean Prop Proliferation by replacing boolean flags with explicit variant components and composition.
  • Promote shared state and behavior via context providers, enabling UI reuse across multiple apps or packages.
  • Support design-system driven APIs and scalable architectures for complex component libraries and UI frameworks.

Quick Start

Refactor a UI by introducing explicit variants (e.g., ThreadComposer, EditMessageComposer) and wrapping with a shared Provider to lift state.

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 by replacing boolean flags with explicit variant components and leveraging composition. Refactor monolithic UIs into distinct variants like ThreadComposer and EditMessageComposer to achieve scalable and reusable React component APIs.

What is the best way to share state across compound components in a design system?

Share state across compound components by wrapping them with a shared context provider. This architecture pattern lifts state management up, enabling flexible UI reuse and consistent behavior across multiple apps or packages within your design system.

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

Refactor a React component library by introducing explicit variants and wrapping them with a shared Provider to lift state. Apply composition patterns using render props, compound components, and context providers to create scalable architectures.

Does this React composition pattern guidance include React 19 API changes?

Yes, the composition pattern guidance includes specific React 19 API changes. It specifies core rules around architecture patterns, state management with providers, explicit variant components, and how to apply React 19 API updates effectively.

When should I use explicit variant components instead of render props in React?

Use explicit variant components to avoid boolean prop proliferation and create clear, predictable APIs. Use render props when you need more flexible UI reuse and custom rendering logic within your React component library or design system architecture.