vercel-composition-patterns

Refactor React component libraries to replace boolean props with variants and providers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Refactor React components to reduce boolean prop proliferation by adopting compound components, lifting state into providers, and composing internals. These patterns enable scalable, reusable APIs and clearer automation-friendly structures.

Core Features & Use Cases

  • Avoid boolean prop proliferation by using compound components and shared context
  • Lift state into provider components to enable cross-component access without prop drilling
  • Define explicit component variants instead of complex boolean flag combinations
  • Build flexible APIs for component libraries and design systems

Quick Start

Refactor a codebase by replacing boolean props with explicit variants and a shared provider to enable scalable, composable components.

Frequently Asked Questions about vercel-composition-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce boolean prop proliferation in React components?

Avoid boolean prop proliferation in React components by adopting compound components and shared context. This pattern replaces complex boolean flags with explicit variants, enabling scalable and reusable component APIs.

How do I lift state into context providers to avoid prop drilling?

Lift state into context provider components to enable cross-component access without prop drilling. This approach creates a generic context interface, allowing UI components to share state seamlessly across multiple providers.

What is the best way to build compound components for a React design system?

The best way to build compound components for a React design system is to compose internals using shared context. This structure creates automation-friendly APIs, allowing users to assemble parent and child components without rigid configuration.

Can I use these composition patterns for React 19 API transitions?

Yes, you can apply these composition patterns to React 19 API transitions. The refactoring approach supports transitioning component libraries by lifting state into providers and defining explicit component variants for the updated API.

When should I refactor React component libraries to use explicit variants?

Refactor React component libraries to use explicit variants when boolean prop combinations become complex and unmanageable. This transition to provider-based state lifting and composition prevents conflicting flags and ensures scalable component architecture.