vercel-composition-patterns

Guide React component architecture with composition patterns and context.

Updated Feb 11, 2026
One-click install
npx skills add https://github.com/lexand-dev/subtrack-monorepo --skill vercel-composition-patterns-lexand-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/lexand-dev/subtrack-monorepo/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/lexand-dev/subtrack-monorepo --skill vercel-composition-patterns-lexand-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexity of managing React component states and props, particularly when dealing with numerous conditional behaviors, by promoting robust composition patterns.

Core Features & Use Cases

  • Avoids Boolean Prop Proliferation: Guides developers to use composition over excessive boolean props for component variants.
  • Compound Components: Facilitates building flexible components with shared context, enabling fine-grained composition.
  • State Management Decoupling: Promotes lifting state into provider components for better reusability and testability.
  • React 19 API Adoption: Includes guidance on new APIs like use() and direct ref usage.
  • Use Case: Refactoring a complex Modal component that has many variations (e.g., confirmation, alert, form) into a set of smaller, composable components that share state via context.

Quick Start

Apply the 'architecture-avoid-boolean-props' rule to refactor a component with too many boolean props.

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, use composition patterns over excessive boolean props for component variants. This approach guides developers to refactor components with many conditional behaviors into smaller, composable elements.

What is the compound components pattern in React?

The compound components pattern in React facilitates building flexible components with shared context, enabling fine-grained composition. It allows developers to create reusable UI elements that share state implicitly without excessive prop drilling.

How do I decouple state management for scalable React architecture?

To decouple state management for scalable React architecture, lift state into provider components. This promotes better reusability and testability by separating state logic from presentational components.

Does this React composition guidance cover React 19 API changes?

Yes, this React composition guidance covers React 19 API changes. It includes specific adoption guidance for new APIs like the `use()` hook and direct `ref` usage to ensure modern component architecture.

What is the best way to refactor a complex Modal component with many variations?

The best way to refactor a complex Modal component with many variations is to break it down into a set of smaller, composable components. These components can then share state via context to handle different modal types cleanly.

When should I not use boolean props for React component variants?

You should not use boolean props for React component variants when dealing with numerous conditional behaviors, as it creates complex and unmaintainable code. Using composition patterns instead facilitates the creation of flexible, testable UI components.