vercel-composition-patterns

Guide React component library design with composition patterns and React 19 APIs.

Updated Nov 23, 2025
One-click install
npx skills add https://github.com/remiconnesson/v0-video2md --skill vercel-composition-patterns-remiconnesson
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/remiconnesson/v0-video2md/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/remiconnesson/v0-video2md --skill vercel-composition-patterns-remiconnesson

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes 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, enable flexible composition, and manage state effectively.

Core Features & Use Cases

  • Component Architecture: Patterns for structuring components to avoid boolean prop overload and promote reusability through compound components.
  • State Management: Strategies for decoupling state logic from UI, defining generic context interfaces, and lifting state into provider components for better accessibility.
  • Implementation Patterns: Guidance on creating explicit component variants and preferring children composition over render props.
  • React 19 APIs: Updates for React 19, including changes to ref handling and context usage with the use() hook.
  • Use Case: Refactoring a large, monolithic React component with many conditional rendering paths into smaller, composable, and more maintainable units.

Quick Start

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

To refactor a React component with too many boolean props, apply compound component patterns to split conditional rendering paths into smaller, composable, and maintainable units. This avoids prop proliferation by distributing state and logic across explicit, decoupled sub-components.

What is the best way to manage state in scalable React component libraries?

The best way to manage state in scalable React component libraries is decoupling state logic from the UI and lifting it into provider components. This approach defines generic context interfaces to handle state distribution and ensure better accessibility across your components.

How does React 19 change context usage and ref handling in composition patterns?

React 19 changes context usage and ref handling by introducing the `use()` hook for consuming context directly and updating ref handling APIs. These updates streamline component composition by simplifying how state and DOM references are passed through component hierarchies.

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

You should use compound components over render props in React when you need flexible UI composition without complex conditional logic. Preferring children composition avoids deep nesting and boolean prop overload, resulting in more explicit component variants and maintainable structures.

Can I use these React composition patterns for large monolithic components?

Yes, you can use these React composition patterns for large monolithic components. They specifically target refactoring complex components with many conditional rendering paths, breaking them down into smaller, composable, and more maintainable units using explicit variants and providers.