vercel-composition-patterns

Refactor React component libraries using compound components and context providers.

2|Updated Jan 12, 2026
One-click install
npx skills add https://github.com/YouMingYeh/shadcn-ui-supabase-docker-template --skill vercel-composition-patterns-youmingyeh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/YouMingYeh/shadcn-ui-supabase-docker-template/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/YouMingYeh/shadcn-ui-supabase-docker-template --skill vercel-composition-patterns-youmingyeh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Composition patterns to tame complexity in React UIs by avoiding boolean prop proliferation and enabling flexible, reusable APIs through compound components, state providers, and explicit variants.

Core Features & Use Cases

  • Provide a framework for structuring components as compound pieces with a shared context.
  • Promote lifting state into providers to enable cross-component access without prop drilling.
  • Support explicit variant components (ThreadComposer, EditMessageComposer, ForwardMessageComposer) to document behavior clearly and reduce IO complexity.

Quick Start

Refactor an existing component library to use explicit variant components backed by a shared provider and frame-based UI.

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?

To reduce boolean prop proliferation in React components, use composition patterns like compound components and explicit variants. This approach structures behavior into separate components backed by a shared context, avoiding complex conditional rendering logic.

What is the best way to build reusable React component libraries with context?

The best way to build reusable React component libraries with context is lifting state into providers. This enables cross-component access without prop drilling, creating a generic context interface that exposes state, actions, and meta.

How do I refactor a React component to use compound components and variants?

Refactor a React component by breaking it into compound pieces sharing a single provider. Create explicit variant components like ThreadComposer or EditMessageComposer to document behavior clearly and reduce IO complexity.

Does this React composition pattern support the React 19 use() API?

Yes, this React composition pattern supports the React 19 API. It provides specific guidance on using the use() hook in place of useContext and passing regular props for ref to align with modern React architectures.

When should I avoid render props and use explicit variant components instead?

You should avoid render props and use explicit variant components when you need to document behavior clearly and reduce IO complexity. Explicit variants like ForwardMessageComposer enforce concrete requirements better than flexible render props.