vercel-composition-patterns

Convert boolean prop components into explicit React variant components with provider-based context.

Updated Feb 1, 2026
One-click install
npx skills add https://github.com/harsh-m-patil/hermes --skill vercel-composition-patterns-harsh-m-patil
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/harsh-m-patil/hermes/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/harsh-m-patil/hermes --skill vercel-composition-patterns-harsh-m-patil

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams replace boolean prop proliferation with explicit React variant components, enabling scalable, readable, and maintainable UI APIs.

Core Features & Use Cases

  • Explicit variants: Replace boolean flags with dedicated components (e.g., ThreadComposer, EditMessageComposer, ForwardMessageComposer).
  • Compound components & context: Build reusable UI pieces that share state via a provider pattern.
  • Design system patterns: Apply to component libraries, render-prop usage, and context-driven architectures for scalable frontends.

Quick Start

Create explicit variant components that compose shared parts of your UI, then render them under a single provider. For example, implement ThreadComposer, EditMessageComposer, and ForwardMessageComposer with their respective providers, and render them in your app to observe the improved readability and composability.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I replace boolean props with explicit React variant components?

To replace boolean props with explicit React variants, create dedicated components like ThreadComposer or EditMessageComposer that compose shared UI parts under a single provider. This pattern improves readability and maintainability by eliminating ambiguous boolean flags.

What is a provider-based architecture for React compound components?

A provider-based architecture for React compound components uses a shared context to distribute state, actions, and meta across reusable UI pieces. It leverages React 19 patterns like the use() hook for context access, enabling flexible interface composition without prop drilling.

When should I use explicit variants instead of boolean flags in a design system?

Use explicit variants instead of boolean flags in a design system when component APIs become hard to read and maintain due to conflicting prop combinations. Dedicated variant components prevent invalid states and scale better for complex, context-driven frontends.

Does this composition pattern work with React 19 context providers?

Yes, this composition pattern works with React 19 context providers. It specifically adopts React 19 patterns like the use() hook for context access, allowing components to consume shared state, actions, and meta efficiently within a provider-based architecture.

What's the best way to structure shared state for render props and context providers?

The best way to structure shared state for render props and context providers is to implement a provider-based architecture. Consolidate state, actions, and meta into a shared context, allowing compound components to consume data uniformly and compose flexible interfaces.