vercel-composition-patterns

Guide React component composition with compound components and context providers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexity of building scalable and maintainable React applications by providing patterns to avoid common pitfalls like boolean prop proliferation and unmanageable state.

Core Features & Use Cases

  • Component Architecture: Learn to structure components using compound components and avoid excessive boolean props.
  • State Management: Implement robust state management by decoupling UI from state logic and lifting state into providers.
  • Implementation Patterns: Discover best practices like preferring children over render props and creating explicit component variants.
  • Use Case: Refactor a large component with many conditional rendering paths into a more maintainable and composable structure using compound components and context providers.

Quick Start

Apply the vercel-composition-patterns skill to refactor the Composer component to use compound components instead of 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 refactor React components with too many boolean props?

Avoid boolean prop proliferation in React by using compound components and context providers. These patterns decouple UI structure from conditional logic, keeping component architecture flexible and clean.

What is the best way to manage state in a reusable React component library?

The best way to manage state is lifting it into context providers. This decouples state logic from UI components, allowing flexible composition without passing props deeply through the component tree.

Should I use render props or children for React composition?

Prefer using children over render props for React composition. This pattern simplifies the component API, avoids deeply nested callback functions, and improves overall codebase readability.

How do I create explicit component variants in React?

Create explicit React component variants by defining separate components for each state instead of using boolean props. This composition pattern prevents complex conditional rendering paths and improves maintainability.

When should I use compound components in React?

Use compound components in React when a large component requires multiple conditional rendering paths or needs shared state. Lifting state into context providers allows the parts to communicate cleanly.