vercel-composition-patterns

Refactor React components into explicit variant and compound patterns.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/SteepCraft/Base-de-datos-2 --skill vercel-composition-patterns-steepcraft
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/SteepCraft/Base-de-datos-2/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/SteepCraft/Base-de-datos-2 --skill vercel-composition-patterns-steepcraft

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Boolean prop proliferation and monolithic components make React codebases hard to maintain. This guide promotes explicit variants, compound components, and provider-based state to build scalable, reusable UI primitives.

Core Features & Use Cases

  • Use explicit variant components (e.g., ThreadComposer, EditMessageComposer) to replace boolean-mode components.
  • Build compound components with a shared context to avoid prop drilling and enable flexible composition.
  • Lift state into providers so UI can be reused across different data sources or domains.

Quick Start

Refactor a monolithic Composer into explicit variant components and corresponding providers to enable scalable reuse.

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 eliminate boolean prop proliferation?

React boolean prop proliferation causes monolithic components that are hard to maintain. Refactoring involves replacing boolean-mode components with explicit variant components and compound patterns, using provider-based state to build scalable, reusable UI primitives.

What is the best way to avoid prop drilling in large React applications?

The best way to avoid prop drilling is building compound components with a shared context. Lifting state into providers enables flexible composition and allows UI to be reused across different data sources or domains without passing props down manually.

How do I use the React 19 use() API instead of useContext for component state?

Use the React 19 use() API instead of useContext to manage provider-based state in compound components. This approach satisfies React 19 API changes for generic context interfaces and uses regular props for ref forwarding.

Does this composition pattern approach work for design systems and component libraries?

Yes, explicit composition patterns apply directly to design systems, component libraries, and large React apps. Refactoring monolithic components into explicit variants and providers ensures scalable, maintainable UI architectures required by these environments.

When should I replace boolean-mode components with explicit variant components?

Replace boolean-mode components with explicit variants when monolithic components make your React codebase hard to maintain. This refactoring eliminates boolean prop proliferation and adopts explicit variants for scalable reuse.

How do I lift state into providers to reuse React UI across different domains?

Lift state into providers to enable flexible composition and reuse React UI across different data sources or domains. This compound component pattern uses a shared context to avoid prop drilling and decouple UI from specific data.