vercel-composition-patterns

Refactor React components into compound structures with provider-lifted state.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps teams eliminate brittle React component APIs caused by boolean prop proliferation and tangled state management, making component libraries easier to maintain and evolve safely.

Core Features & Use Cases

  • Compound component architecture: build flexible React component suites that share state via context rather than prop drilling.
  • State management boundaries: isolate state implementation inside provider components so UI pieces remain reusable across different data sources.
  • Dependency-injected context contracts: define a generic context interface (state, actions, meta) so the same UI works with multiple providers.
  • Implementation rules for maintainability: prefer explicit component variants, lift state to providers, and compose via children instead of render props.

Quick Start

Ask the AI to apply the vercel-composition-patterns rules to a React component you want to refactor to remove boolean props and replace them with explicit variants and a compound-component/context-provider structure.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I refactor React components to remove boolean prop proliferation?

To remove boolean prop proliferation from React components, refactor them into explicit variant components and a compound-component structure using context providers. This eliminates conditional UI branches by lifting state to providers.

What is the best way to share state across React compound components without prop drilling?

The best way to share state across React compound components without prop drilling is using context providers. Define a generic context interface containing state, actions, and meta to isolate state implementation from reusable UI pieces.

When should I use children instead of render props for reusable React component APIs?

You should use children instead of render props for reusable React component APIs when composing compound components. This approach maintains maintainability by keeping UI pieces reusable across different data sources without tightly coupling state logic.

How do I isolate state management boundaries in a React component library?

You isolate state management boundaries in a React component library by lifting state to provider components. Define a dependency-injected context contract with state, actions, and meta so UI components remain decoupled from specific data sources.

Does refactoring React components into compound components work with existing TypeScript interfaces?

Yes, refactoring React components into compound components works with TypeScript by defining a generic context interface. This TypeScript interface structures state, actions, and meta, ensuring the same UI works safely with multiple context providers.