vercel-composition-patterns

Refactor React components using composition patterns instead of boolean props.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/vijaychandar186/nextjs-bun-agentic-starter --skill vercel-composition-patterns-vijaychandar186
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/vijaychandar186/nextjs-bun-agentic-starter/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/vijaychandar186/nextjs-bun-agentic-starter --skill vercel-composition-patterns-vijaychandar186

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Replacing boolean prop proliferation with structured composition patterns to build scalable React components and reusable APIs.

Core Features & Use Cases

  • Composition-first design: build components as modular pieces (Frame, Input, Submit) and assemble them without ad-hoc booleans.
  • Provider-based state management: lift state into providers to enable sharing between UI bits and outside helpers.
  • Explicit variants and pattern guidance: prefer explicit variant components (ThreadComposer, EditComposer, ForwardComposer) over multi-mode booleans, and follow context-driven patterns; includes migration guidance for React 19 APIs.

Quick Start

Review the compiled guidelines and bootstrap a small example using a Frame with Input and Submit under a Provider to observe shared state flow.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I scale React components using composition patterns instead of boolean props?

To scale React components using composition patterns, replace multi-mode boolean props with modular pieces like Frame, Input, and Submit, assembling them through explicit variant components and context providers to create reusable APIs.

What is the best way to avoid prop drilling in React component libraries?

The best way to avoid prop drilling in React component libraries is lifting shared state into context providers, enabling provider-based state management that allows modular UI components to access data without ad-hoc prop passing.

When do I need explicit variant components versus multi-mode booleans in React?

You need explicit variant components like ThreadComposer or EditComposer when a React component requires distinct operational modes, replacing multi-mode booleans to provide structured, context-driven UI with clearer and more maintainable APIs.

How do I migrate React components to use context providers and forwardRef?

Migrate React components to use context providers and forwardRef by applying context-driven composition patterns, replacing boolean prop logic with provider-based state management and explicit variants, including guidance for React 19 API changes.

Should I use render-props or children patterns for compound components in React?

Choosing between render-props or children for compound components in React depends on your state sharing needs; both patterns support context-driven UI, allowing modular pieces to assemble without ad-hoc booleans while avoiding prop drilling.

Does this React composition approach support refactoring existing component libraries?

Yes, this React composition approach supports refactoring existing component libraries by replacing boolean prop proliferation with structured composition patterns, building modular reusable APIs using context providers and explicit variants.