vercel-composition-patterns

Refactor React components to replace boolean props with composition patterns.

Updated Nov 26, 2025
One-click install
npx skills add https://github.com/guiledo/dotfiles --skill vercel-composition-patterns-guiledo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/guiledo/dotfiles/tree/main/opencode/.config/opencode/skills/vercel-composition-patterns
Command: npx skills add https://github.com/guiledo/dotfiles --skill vercel-composition-patterns-guiledo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide addresses the challenge of boolean prop proliferation by promoting composition patterns, explicit component variants, and shared context to build scalable React libraries.

Core Features & Use Cases

  • Explicit component variants (for example, ThreadComposer, EditMessageComposer) replace multi-flag components.
  • Compound components with a shared context to reduce prop drilling and improve reuse.
  • State lifting and dependency-injected contexts enabling UI to be reused across providers while keeping UI logic separate.

Quick Start

Demonstrate replacing boolean props with explicit component variants and provider-based state management to compose reusable React 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 refactor React components to stop boolean prop proliferation?

Eliminate boolean prop proliferation by refactoring React components into explicit variants and compound components using shared context. This composition approach replaces multi-flag components, reducing prop drilling and improving UI reuse.

What is the best way to build a reusable React component library with composition patterns?

Build scalable React component libraries by applying composition patterns, explicit variants, and compound components. Define a provider context with state and actions to separate UI logic, enabling clean reuse across different context providers.

How do I create explicit component variants in React instead of using multiple boolean props?

Create explicit component variants, such as ThreadComposer or EditMessageComposer, to replace multi-flag components. Use compound components with a shared context to manage state and actions, ensuring clean UI separation and reducing prop drilling.

Can I use React 19 APIs for context providers and state lifting?

You can migrate to React 19 APIs to create context providers and lift state. Define a provider context with state, actions, and meta to enable UI reuse across providers, maintaining a clean separation between UI and state logic.

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

Use compound components and context providers when building reusable component libraries, designing explicit variants, or migrating to React 19 APIs. This approach eliminates boolean prop proliferation and maintains clean separation between UI and state.