vercel-composition-patterns

Refactor React components with boolean props into explicit variants using composition patterns.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the complexity of building maintainable and scalable React components by providing patterns to avoid prop proliferation and enable flexible composition.

Core Features & Use Cases

  • Composition Patterns: Learn to use compound components, lift state, and compose internals effectively.
  • Avoid Boolean Props: Eliminate unmaintainable conditional logic caused by excessive boolean props.
  • React 19 APIs: Understand new APIs like use() and ref handling in React 19.
  • Use Case: Refactor a large, monolithic React component with many conditional rendering paths into a set of smaller, composable components that are easier to manage and extend.

Quick Start

Use the vercel-composition-patterns skill to refactor a component that uses many boolean props into explicit variants.

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 prop proliferation when building scalable React components?

To avoid prop proliferation in React components, use composition patterns like compound components and explicit variants. This approach replaces unmaintainable conditional logic with smaller, composable elements to enhance maintainability.

What are compound components in React and how do they manage state?

Compound components in React are a composition pattern where related UI pieces share implicit state. State management is handled by lifting state into providers, allowing individual components to access data without excessive prop drilling.

How do I refactor a monolithic React component with many conditional rendering paths?

Refactor a monolithic React component by decomposing it into smaller, composable internals using explicit variants. Replace boolean props and conditional rendering paths with compound components to manage functionality and extend the UI library efficiently.

Does this React component architecture pattern support React 19 APIs?

Yes, the composition patterns accommodate React 19 APIs. Guidelines cover using the new `use()` hook and updated ref handling to build scalable, maintainable component architectures within your UI libraries.

Why should I use explicit variants instead of boolean props in component architecture?

Explicit variants prevent the unmaintainable conditional logic caused by multiple boolean props. By defining clear variant states, you create predictable component behavior, making your React architecture easier to manage and extend.