vercel-composition-patterns

Refactor React components into compound composition patterns with lifted state and context providers.

Updated Mar 2, 2026
One-click install
npx skills add https://github.com/FerranGuardia/claude-autonomous-setup --skill vercel-composition-patterns-ferranguardia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/FerranGuardia/claude-autonomous-setup/tree/main/skills/frontend/react-composition
Command: npx skills add https://github.com/FerranGuardia/claude-autonomous-setup --skill vercel-composition-patterns-ferranguardia

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React codebases often suffer from boolean prop proliferation that leads to tangled conditionals and hard-to-maintain APIs. This guide promotes composition-driven patterns—compound components, lifted state, and contextual providers—to create flexible, reusable UI.

Core Features & Use Cases

  • Avoid boolean prop proliferation by structuring components as composable frames with explicit variants.
  • Lift state into providers to share state across disparate UI parts without prop drilling.
  • Build flexible, reusable APIs that can be swapped behind the UI with different providers or variants; supports React 19 API practices.

Quick Start

Create explicit variant components (ThreadComposer, EditMessageComposer, ForwardMessageComposer) and wire them to shared providers to adopt the patterns.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I eliminate boolean prop proliferation in React components?

To eliminate boolean prop proliferation in React components, structure your UI as composable frames using explicit variant components and compound components, preventing tangled conditionals and hard-to-maintain APIs.

What is the best way to share state across disparate React UI parts without prop drilling?

The best way to share state across disparate React UI parts without prop drilling is to lift state into context providers, utilizing shared interfaces for state, actions, and meta to ensure flexible communication.

How do I build reusable React component APIs with compound components?

Build reusable React component APIs with compound components by creating explicit variants like ThreadComposer or EditMessageComposer and wiring them to shared providers to allow swapping implementations behind the UI.

Does this React composition pattern support React 19 API practices?

Yes, this React composition pattern supports React 19 API practices by adopting the use() hook in place of useContext and avoiding forwardRef wrappers to modernize context providers and state management.

When should I refactor my React component library to use composition patterns?

You should refactor your React component library to use composition patterns when scaling UIs across projects, building flexible reusable APIs, or needing to swap different providers or variants behind the UI without breaking it.