vercel-composition-patterns

Refactor React component APIs by replacing boolean props with explicit variants.

2.0k|254|Updated Nov 29, 2025
One-click install
npx skills add https://github.com/Draculabo/AntigravityManager --skill vercel-composition-patterns-draculabo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/Draculabo/AntigravityManager/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/Draculabo/AntigravityManager --skill vercel-composition-patterns-draculabo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Composition patterns that scale React components, replacing boolean prop proliferation with structured, reusable APIs through compound components and context providers.

Core Features & Use Cases

  • Avoid boolean prop proliferation by using explicit variants, compound components, and shared state.
  • Build flexible component libraries and reusable APIs with context and providers.
  • Use these patterns for refactoring large UIs, creating stable design systems, and enabling AI-assisted tooling.

Quick Start

Refactor a component by replacing boolean props with explicit variants and wrap the UI in a provider to share state.

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, replace them with explicit variants and use compound components to structure reusable APIs. This pattern simplifies component interfaces by preventing conflicting boolean states and ensuring predictable rendering.

What is the best way to build a flexible React component library with shared state?

The best way to build a flexible React component library is by applying composition patterns using context providers and compound components. This approach shares state across UI parts cleanly, preventing prop drilling and ensuring scalable, reusable design systems.

How do I refactor a React UI to use composition patterns?

Refactor a React UI by replacing boolean props with explicit variants and wrapping the UI elements in a context provider to share state. Apply these composition patterns to stabilize design systems and refactor reusable APIs across projects.

Does this React composition approach work with React 19 API guidelines?

Yes, this React composition approach works with React 19 API guidelines by enforcing explicit variants, compound components with shared context, and modern provider patterns. It ensures your refactored component libraries and design systems align with current React standards.

When should I use compound components instead of standard boolean props?

Use compound components instead of standard boolean props when building scalable React component libraries that need shared context. This approach prevents API bloat from conflicting boolean combinations and provides a structured, reusable interface for large UIs.

Can I use these composition patterns to refactor an existing design system?

Yes, you can use these composition patterns to refactor existing design systems by replacing boolean props with explicit variants and context providers. This structured refactoring enables stable, reusable UI APIs and supports large-scale interface updates across projects.