vercel-composition-patterns

Replace boolean props with compound components, context providers, and explicit variants.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/Happy-Horizon/cursor-marketplace --skill vercel-composition-patterns-happy-horizon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/Happy-Horizon/cursor-marketplace/tree/main/synced-vendor-skills/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/Happy-Horizon/cursor-marketplace --skill vercel-composition-patterns-happy-horizon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Replacing boolean props with well-structured composition and context-driven APIs to simplify component libraries and improve maintainability.

Core Features & Use Cases

  • Establish explicit component variants (ThreadComposer, EditMessageComposer, ForwardMessageComposer) to avoid combinatorial boolean props.
  • Leverage compound components and shared context to compose UIs without prop drilling.
  • Apply lift-state patterns with providers to enable UI components to work with multiple state implementations.

Quick Start

Create a minimal ThreadComposer example to demonstrate explicit variant usage and provider-backed state sharing.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I replace boolean props with compound components in React?

To replace boolean props with compound components in React, you structure explicit variants like ThreadComposer alongside shared context providers. This avoids combinatorial prop explosions and simplifies your component library API surface.

What is the best way to scale React components without prop drilling?

The best way to scale React components without prop drilling is leveraging compound components and shared context providers. This pattern lifts state into providers, enabling flexible UI composition across multiple state implementations.

Does this React composition pattern approach work with React 19 API changes?

Yes, this React composition pattern approach works with React 19 API changes. It guides context interfaces, explicit variants, and safe UI patterns to ensure architecture clarity and state lifting during refactoring tasks.

When do I need explicit component variants instead of boolean props?

You need explicit component variants instead of boolean props when facing complex combinatorial states, such as creating ThreadComposer, EditMessageComposer, and ForwardMessageComposer. This establishes architecture clarity and avoids maintaining overlapping boolean flags.

How do I use context providers to share state across React components?

To use context providers to share state across React components, you apply lift-state patterns to enable UI components to work with multiple state implementations. This establishes a shared context interface for flexible composition without prop drilling.