vercel-composition-patterns

Refactor React component libraries with composition patterns and context providers.

Updated Apr 24, 2026
One-click install
npx skills add https://github.com/featurectrl/website --skill vercel-composition-patterns-featurectrl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/featurectrl/website/tree/main/.claude/skills/vercel-composition-patterns
Command: npx skills add https://github.com/featurectrl/website --skill vercel-composition-patterns-featurectrl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps teams reduce boolean prop proliferation by promoting composition, compound components, and dependency-injected state to create flexible, reusable React APIs.

Core Features & Use Cases

  • Encourages explicit variant components (ThreadComposer, EditMessageComposer, ForwardMessageComposer) to replace boolean mode flags.
  • Guides lifting state into providers and building shared context interfaces for UI components.
  • Covers React 19 API changes and migration notes for forwardRef and use() usage in context.

Quick Start

Create an explicit variant such as ThreadComposer to demonstrate the pattern with a provider-managed shared state.

Frequently Asked Questions about vercel-composition-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce boolean prop proliferation in React components?

Reduce boolean prop proliferation in React components by replacing mode flags with explicit variant components like ThreadComposer. This refactor lifts shared state into context providers to ensure flexible, maintainable APIs.

What is the best way to manage shared state across compound components in a design system?

Managing shared state across compound components requires lifting state into a context provider. This pattern enforces a generic context interface, delivering maintainable architecture and reusable internals for UI frameworks.

How do I create explicit variant components instead of using boolean mode flags?

Create explicit variant components by defining separate elements such as ThreadComposer and EditMessageComposer instead of passing boolean props. This approach establishes flexible React APIs and aligns with React 19 APIs.

Does this React composition pattern work with React 19 APIs?

Yes, this React composition pattern works with React 19 APIs by providing migration notes for forwardRef and applying the use() hook for context. It ensures your component library maintains alignment with the latest framework updates.

When should I use context providers over render props in React architecture?

Use context providers over render props when you need to lift state into a shared interface for compound components. Providers reduce prop drilling and enforce a maintainable architecture for complex UI frameworks.