vercel-composition-patterns

Refactor React components to replace boolean props with explicit variants.

Updated Oct 27, 2025
One-click install
npx skills add https://github.com/SomtoUgeh/dotfiles --skill vercel-composition-patterns-somtougeh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/SomtoUgeh/dotfiles/tree/main/claude/skills/vercel-composition-patterns
Command: npx skills add https://github.com/SomtoUgeh/dotfiles --skill vercel-composition-patterns-somtougeh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a targeted approach for scaling React component design by eliminating boolean prop proliferation and enabling flexible APIs via composition, compound components, and context-driven patterns.

Core Features & Use Cases

  • Explicit variants: Replace multi-flag components with dedicated variant components (e.g., ThreadComposer, EditMessageComposer) to improve readability and maintainability.
  • Compound components with shared context: Build UI as a suite of interdependent parts that access shared state via a provider.
  • Provider-based state management: Lift state into providers to enable cross-surface reuse and composition across UI.

Quick Start

Create a sample React component library that replaces boolean props with explicit variants and implements a provider-based state pattern to demonstrate flexible component composition.

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, refactor multi-flag components into explicit variant components, replacing conditional logic with dedicated, readable component definitions.

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

The best way to manage shared state across compound components is by lifting state into a context provider, enabling cross-surface reuse and flexible composition across your UI.

How do I refactor a monolithic UI component into explicit variants?

Refactor a monolithic UI component into explicit variants by separating conditional rendering logic into distinct, dedicated components like ThreadComposer or EditMessageComposer for improved maintainability.

Does this React component composition approach work with React 19?

Yes, this React component composition approach works with React 19, providing API guidance that enforces explicit component variants and provider-based state management for modern React development.

Why use context providers for component state instead of nested props?

You use context providers for component state instead of nested props to eliminate prop drilling, allowing compound components to access shared state directly and compose flexibly across surfaces.

When should I use compound components in a design system?

Use compound components in a design system when building suites of interdependent UI parts that require shared context, flexible APIs, and robust composition without boolean prop proliferation.