vercel-composition-patterns

Replace boolean props with explicit variant components and shared context in React libraries.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Refactoring component libraries to avoid Boolean prop proliferation by embracing composition patterns such as compound components, context Providers, and explicit variant APIs.

Core Features & Use Cases

  • Replace boolean props with explicit variant components (e.g., ThreadComposer, EditMessageComposer, ForwardMessageComposer) to keep code self-documenting.
  • Use a shared Provider to lift and share state across UI pieces, reducing prop drilling and enabling outside UI access.
  • Build scalable component libraries with compound components and generic context interfaces that decouple UI from state management.

Quick Start

Refactor components by replacing boolean props with explicit variant components and 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 refactor React components to avoid boolean prop proliferation?

You can replace boolean props with explicit variant components, such as ThreadComposer or ForwardMessageComposer, to keep your React code self-documenting and maintainable while reducing prop drilling.

What is the best way to scale React component libraries with composition?

The best way to scale React component libraries is by applying compound components, context Providers, and generic context interfaces to decouple UI from state management and enable scalable composition.

Does this React composition pattern work with React 19 API patterns?

Yes, this composition pattern enforces a provider-driven state model and explicit variant components while ensuring compatibility with React 19 API patterns for scalable UI systems.

When should I use compound components and context providers in React?

Use compound components and context providers in React when you need to lift and share state across UI pieces, reduce prop drilling, and build scalable component libraries that decouple UI from state management.

Why does prop drilling make React component libraries hard to maintain?

Prop drilling makes React component libraries hard to maintain because boolean props create complex variant logic, whereas lifting state with a shared Provider and explicit variant components keeps code self-documenting and scalable.