vercel-composition-patterns

Replace boolean props with compound components and context-driven APIs in React.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Composition patterns provide a robust path to scale React UI by replacing boolean props with explicit, reusable building blocks.

Core Features & Use Cases

  • Explicit variant components that share state via providers.
  • Decoupled UI from state implementation for flexible integration.
  • Guidance on render props vs children for clean composition, including React 19 API usage.

Quick Start

Refactor a small component library by replacing boolean props with explicit variant components and a shared provider.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I replace boolean props with React composition patterns?

React composition patterns replace boolean props by breaking monolithic UI into explicit variant components and compound components, using context-driven APIs to share state without rigid prop drilling, ensuring predictable and maintainable code.

What is the best way to build a reusable React component library with explicit variants?

Building reusable React component libraries with explicit variants involves decoupling UI from state implementation using provider-based state, allowing flexible integration and clean composition via render props or children based on React 19 API guidance.

How do compound components share state in React without prop drilling?

Compound components share state in React by utilizing context-driven APIs and providers, allowing explicit variant components to access shared state directly without prop drilling, resulting in ergonomic UI composition.

When should I use render props vs children for React component composition?

Use render props vs children for React component composition based on flexibility needs; guidance includes React 19 API usage to decouple UI from state implementation, ensuring clean composition and explicit variant components for maintainable codebases.

Does this React composition approach work for refactoring existing components in large codebases?

This React composition approach works for refactoring existing components in large codebases by applying composition principles to replace boolean props with compound components, designing robust APIs and ensuring predictable, maintainable code.