vercel-composition-patterns

Implement scalable React component APIs using composition patterns.

Updated Feb 4, 2026
One-click install
npx skills add https://github.com/hakushun/ai-dev-starter --skill vercel-composition-patterns-hakushun
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/hakushun/ai-dev-starter/tree/main/.cursor/skills/vercel-composition-patterns
Command: npx skills add https://github.com/hakushun/ai-dev-starter --skill vercel-composition-patterns-hakushun

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide helps teams reduce boolean prop proliferation and tangled UI logic by teaching explicit variants, compound components, and provider-based state management.

Core Features & Use Cases

  • Clear variant components that document intent and reduce conditional rendering.
  • Shared-state patterns via context providers, enabling UI components to be used with different state implementations.
  • Patterns for avoiding prop drilling and enabling flexible composition across UI libraries.

Quick Start

Begin by extracting common UI fragments into a provider-based frame and create explicit variant components for each use case. Then compose components from the frame and pass the provider as needed.

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, implement explicit variant components and compound components. This approach documents intent clearly and reduces tangled conditional rendering logic in your UI.

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

The best way to share state without prop drilling is using context providers. This pattern enforces a generic context interface with state, actions, and meta, enabling UI components to use different state implementations flexibly.

How do I refactor complex React components into reusable composition patterns?

Refactor complex React components by extracting common UI fragments into a provider-based frame. Create explicit variant components for each use case, then compose components from the frame and pass the provider as needed.

Does React 19 change how I should use context providers for composition?

React 19 changes context consumption by guiding migration toward the use() hook over useContext. This update modernizes context provider patterns and maintains a generic interface for state, actions, and meta.

When should I use compound components over render props in React?

Use compound components over render props to scale React components with robust composition. Compound components provide a generic context interface and explicit variants, avoiding conditional rendering while building flexible APIs.