vercel-composition-patterns

Guide React component composition with compound components and generic context interfaces.

Updated Jan 24, 2026
One-click install
npx skills add https://github.com/FlorinSenoner/the-dahan-codex --skill vercel-composition-patterns-florinsenoner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/FlorinSenoner/the-dahan-codex/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/FlorinSenoner/the-dahan-codex --skill vercel-composition-patterns-florinsenoner

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 enable flexible composition, making codebases easier to manage as they scale.

Core Features & Use Cases

  • Component Architecture: Strategies to avoid boolean prop proliferation and utilize compound components.
  • State Management: Techniques for decoupling state from UI, defining generic context interfaces, and lifting state into providers.
  • Implementation Patterns: Guidance on creating explicit component variants and preferring children over render props.
  • React 19 APIs: Specific considerations for newer React features like use() and regular ref props.
  • Use Case: Refactor a large, monolithic Card component that uses numerous boolean props (e.g., isLarge, isHoverable, showIcon, hasBorder) into a more composable structure using compound components and explicit variants.

Quick Start

Apply the vercel-composition-patterns skill to refactor the UserProfileCard 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 avoid boolean prop proliferation in React components?

Avoid boolean prop proliferation in React components by adopting compound components and creating explicit component variants. This approach replaces multiple boolean props with a flexible, composable structure, making your codebase easier to manage as it scales.

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

The best way to manage state in scalable React component architecture is decoupling state from UI, defining generic context interfaces, and lifting state into providers. This ensures maintainable component structures as your application expands.

How do I refactor a monolithic React component into compound components?

Refactor a monolithic React component into compound components by replacing numerous boolean props with explicit variants and preferring children over render props. This strategy enables flexible composition and significantly reduces code complexity.

Can I use React 19 APIs like use() and ref props for component composition?

Yes, you can use React 19 APIs for component composition. Specific considerations and guidelines are provided for newer React features like the use() hook and regular ref props to ensure your component architecture remains modern and maintainable.

When should I prefer children over render props in React component architecture?

Prefer children over render props in React component architecture when building scalable components. This implementation pattern is recommended alongside explicit component variants to ensure flexible composition and avoid common architectural pitfalls.

How do I define generic context interfaces for React state management?

Define generic context interfaces for React state management by lifting state into providers and decoupling it from the UI. This technique allows you to effectively manage state across scalable, composable component structures without prop drilling.