vercel-composition-patterns

Refactor React components to replace boolean props with explicit variants and context providers.

46|5|Updated Feb 14, 2026
One-click install
npx skills add https://github.com/henriquearthur/better-spring-initializr --skill vercel-composition-patterns-henriquearthur
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/henriquearthur/better-spring-initializr/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/henriquearthur/better-spring-initializr --skill vercel-composition-patterns-henriquearthur

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React composition patterns that scale, including explicit variants, compound components, and context-driven state management, help teams avoid boolean prop proliferation and design reusable APIs.

Core Features & Use Cases

  • Explicit variant components replace boolean props and document rendering intent.
  • Compound components with shared context reduce prop drilling and enable flexible composition.
  • Generic context interfaces enable dependency injection across multiple providers.
  • State lifting into providers allows non-UI components to access and modify shared state.
  • Guidance for React 19 API changes and modern patterns for context and hooks.

Quick Start

Refactor a React component using explicit variants and a provider-based state model to replace boolean props.

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 explicit variants in React?

You replace boolean props by creating distinct variant components that explicitly document rendering intent, which simplifies the API surface and avoids complex conditional rendering logic inside a single component.

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

The best way to manage shared state across compound components without prop drilling is lifting state into context providers, enabling child components to access and modify shared state directly via generic context interfaces.

How does generic context interface design work for dependency injection in React 19?

Generic context interfaces enable dependency injection by allowing multiple providers to pass shared state and functions down the React component tree, ensuring non-UI components can access and modify provider-based state.

When do I need explicit variant components instead of conditional rendering?

You need explicit variant components instead of conditional rendering when API surfaces scale, as explicit variants replace boolean props to document rendering intent, making reusable library designs and component APIs easier to maintain.

Can I use render props and compound components together with context providers?

Yes, you can use render props and compound components together with context providers to achieve flexible composition, allowing shared state to be lifted into providers and accessed by non-UI components across React 19.

Why does prop drilling cause issues in scalable React architecture?

Prop drilling causes issues in scalable React architecture because it tightly couples components and increases maintenance overhead, which shared context providers and compound components solve by centralizing state management.