vercel-composition-patterns

Guide React component refactoring using compound components and context providers.

4|Updated Feb 23, 2026
One-click install
npx skills add https://github.com/fysoul17/one-query-v1 --skill vercel-composition-patterns-fysoul17
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/fysoul17/one-query-v1/tree/main/.claude/skills/vercel-composition-patterns
Command: npx skills add https://github.com/fysoul17/one-query-v1 --skill vercel-composition-patterns-fysoul17

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide helps teams avoid boolean prop proliferation by adopting compound components, context providers, and explicit variants to build scalable React patterns.

Core Features & Use Cases

  • Structure complex components as compound components with shared context to enable flexible composition.
  • Lift state into providers so UI remains UI-focused and state is reusable across different use cases.
  • Use explicit variants (e.g., ThreadComposer, EditMessageComposer, ForwardMessageComposer) to document and implement patterns clearly, with React 19 API compatibility.

Quick Start

Start by replacing boolean-driven components with explicit variants (ThreadComposer, EditMessageComposer, ForwardMessageComposer) and wire them to a shared Composer context

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 when scaling React components?

Compound components in React use shared context to structure complex UIs, enabling flexible composition so child components can communicate without prop drilling. This pattern keeps UI focused while lifting reusable state into providers.

How do I build compound components with shared context in React?

Compound components in React use shared context to structure complex UIs, enabling flexible composition so child components can communicate without prop drilling. This pattern keeps UI focused while lifting reusable state into providers.

How to refactor a React component into explicit variants?

The React 19 API introduces the use() hook to replace useContext when consuming context in composition patterns. This allows component libraries to read context providers with more flexible control flow.

Does the React 19 use() hook replace useContext for composition patterns?

The React 19 API introduces the use() hook to replace useContext when consuming context in composition patterns. This allows component libraries to read context providers with more flexible control flow.

When should I lift state into a provider in React?

Render-props in React composition provide a function-as-child pattern to share rendering logic across UI primitives. They allow parent components to pass rendering logic down, offering dynamic flexibility without boolean prop conditionals.

What is the render-props pattern for React UI primitives?

Render-props in React composition provide a function-as-child pattern to share rendering logic across UI primitives. They allow parent components to pass rendering logic down, offering dynamic flexibility without boolean prop conditionals.