vercel-composition-patterns

Refactors React component APIs to replace boolean props with explicit composition patterns.

1|Updated Apr 19, 2026
One-click install
npx skills add https://github.com/arthtyagi/onloop --skill vercel-composition-patterns-arthtyagi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/arthtyagi/onloop/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/arthtyagi/onloop --skill vercel-composition-patterns-arthtyagi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you redesign React components that have grown brittle from boolean props, hidden modes, prop drilling, and tightly coupled state. It gives you a clearer way to structure reusable UI so variants stay explicit and maintainable as a codebase scales.

Core Features & Use Cases

  • Component Architecture Guidance: Replace boolean prop proliferation with explicit component variants and compound components.
  • State Sharing Patterns: Move state into providers so sibling components and surrounding UI can access the same data without awkward refs or prop chains.
  • Modern React API Advice: Apply React 19-friendly patterns such as using use() for context access and treating ref as a regular prop when appropriate.
  • Use Case: Refactor a composer, dialog, or messaging interface into reusable pieces where headers, inputs, footers, previews, and actions all compose cleanly around shared context.

Quick Start

Ask for a refactor that replaces boolean props with explicit composition, shared context, and provider-based state for your target React 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 refactor React components to remove boolean prop proliferation?

Replace boolean prop proliferation in React components with explicit component variants and compound components. This refactoring pattern eliminates rigid configuration props, making UI structure maintainable and preventing hidden mode logic from causing brittle code.

What is the best way to share state across sibling React components without prop drilling?

Lift shared state into context providers so sibling React components access the same data without prop drilling or awkward refs. This composition pattern keeps reusable UI pieces cleanly connected to shared state across your component tree.

How does the use() hook change context usage in React 19?

The use() hook replaces useContext() for React 19-aware context access, allowing components to read context values with a modern API. This streamlines context consumption when refactoring providers and applying composition patterns in modern React codebases.

When should I use compound components instead of render props in React?

Use compound components instead of render props when building reusable UI libraries requiring explicit composition. Compound components let headers, inputs, footers, and actions compose cleanly around shared context, eliminating rigid render-prop replacement patterns.

Can I use this composition pattern for refactoring a dialog or messaging interface?

Yes, composition patterns apply to refactoring dialogs or messaging interfaces into reusable pieces. Headers, inputs, footers, previews, and actions compose cleanly around shared context, keeping the UI reusable and dependency-injectable as it scales.

Why do my reusable React components become brittle as the codebase scales?

Reusable React components become brittle from boolean props, hidden modes, prop drilling, and tightly coupled state as codebases scale. Redesigning with explicit composition patterns and provider-based state keeps variants maintainable and UI decoupled.