vercel-composition-patterns

Guide React component libraries toward composition patterns with compound components and context providers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Addresses the challenge of boolean prop proliferation and monolithic UI components by guiding teams to adopt composition patterns, compound components, and context-driven state management.

Core Features & Use Cases

  • Compound components enable sharing state via context to compose UI without prop drilling.
  • Explicit variants promote clear, self-documenting components like ThreadComposer, EditMessageComposer, and ForwardMessageComposer.
  • State lifting and provider-based architecture allow sharing UI state across unrelated parts of the app.

Quick Start

Create explicit variant components (e.g., ThreadComposer, EditMessageComposer, ForwardMessageComposer) and wrap each with its corresponding provider to enable shared state and consistent 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 fix React component prop proliferation when managing multiple UI states?

Fix React component prop proliferation by adopting compound components and context-driven state management. This approach replaces sprawling boolean props with explicit component variants and shared providers, keeping UI logic separated and maintainable.

What are explicit variants in React and when should I use them?

Explicit variants in React are self-documenting components like ThreadComposer or EditMessageComposer that encapsulate specific use cases. Use them to replace monolithic UI components and avoid boolean prop combinations that create complex rendering logic.

How do I share state across React components without prop drilling?

Share state across React components without prop drilling by using context providers to lift state. Compound components consume this generic context interface—containing state, actions, and meta—to compose UI elements without passing props down manually.

Can I use React 19 APIs for context providers in compound components?

Yes, the composition pattern enforces React 19 API guidance for context providers. You wrap explicit variant components with their corresponding providers to enable shared state and consistent UI across your application.

What's the best way to refactor a monolithic React component into scalable parts?

The best way to refactor a monolithic React component is to break it into explicit variants and compound components. Wrap each variant with a context provider to manage state lifting, eliminating boolean prop sprawl and ensuring scalable composition.

When should I not use compound components for React UI libraries?

Avoid compound components when building simple, isolated UI elements that do not require shared state or multiple variants. If a component lacks complex state dependencies, introducing context providers and composition patterns adds unnecessary architectural overhead.