vercel-composition-patterns

Design scalable React components with explicit variants and compound components.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Ermianr/meteor --skill vercel-composition-patterns-ermianr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/Ermianr/meteor/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/Ermianr/meteor --skill vercel-composition-patterns-ermianr

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexity involved in designing React components that avoid boolean prop proliferation, enabling clean and scalable component architecture.

Core Features & Use Cases

  • Component Architecture: Promotes composition over boolean flags, making component variants explicit and self-describing.
  • State Management: Demonstrates lifting state into context providers for flexible sharing across components.
  • Implementation Patterns: Recommends using compound components with shared context for maintainability.
  • Usage Scenario: When refactoring a chat application's message composer to support multiple modes (edit, thread, forward) without overloading component props.

Quick Start

Follow these guidelines to refactor a React component into explicit variants, utilizing context providers and compound components for scalable architecture.

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?

To avoid boolean prop proliferation in React components, refactor conditional flags into explicit variants and compound components, utilizing shared context providers to manage state cleanly.

What is the best way to manage shared state in compound components?

The best way to manage shared state in compound components is by lifting the state into context providers, allowing flexible state sharing across nested components without excessive prop drilling.

Does this React composition pattern work with React 19?

Yes, these React composition patterns support React 19 compatibility by adopting the use() hook in place of useContext and using normal refs instead of forwardRef for effective component architecture.

How do I refactor a chat message composer for multiple modes like edit and forward?

To refactor a chat message composer for multiple modes, implement explicit component variants and compound components with shared context, preventing prop overload when supporting edit, thread, and forward modes.

When should I use compound components in React?

You should use compound components in React when building scalable, maintainable component APIs that require flexible state sharing across related sub-components without relying on complex boolean conditionals.