vercel-composition-patterns

Guide React component composition with compound components and context providers.

Updated Mar 11, 2026
One-click install
npx skills add https://github.com/sckroll/nextjs-mariadb-sample --skill vercel-composition-patterns-sckroll
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/sckroll/nextjs-mariadb-sample/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/sckroll/nextjs-mariadb-sample --skill vercel-composition-patterns-sckroll

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the complexity of building and maintaining React components by providing patterns to avoid prop proliferation and create more flexible, scalable UIs.

Core Features & Use Cases

  • Component Architecture: Learn to avoid boolean prop issues and utilize compound components effectively.
  • State Management: Understand how to lift state and define generic context interfaces for better decoupling.
  • 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 set of smaller, composable components that are easier to understand and extend.

Quick Start

Apply the 'architecture-avoid-boolean-props' rule to refactor the provided 'Composer' component.

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, apply architectural rules to refactor conditional rendering paths into smaller, composable components. This enhances maintainability and scalability by preventing complex conditional logic within a single component.

What is the best way to manage state with context providers in React?

The best way to manage state with context providers in React is to lift state and define generic context interfaces. This decouples state management from UI rendering, promoting better maintainability and scalable component architecture.

How do I implement compound components in React for scalable UIs?

Implementing compound components in React involves breaking down large components with many conditional paths into smaller, composable pieces. This pattern creates flexible, scalable UIs that are easier to understand and extend over time.

Should I prefer children composition or render props in React?

You should prefer children composition over render props in React. This implementation pattern simplifies component architecture and enhances flexibility, making the resulting UIs easier to maintain and scale effectively.

Does this React composition approach work with React 19 API changes?

Yes, this React composition approach includes specific advice for React 19 API changes regarding refs and context. It provides updated best practices to ensure your component architecture remains compatible with the latest API.