vercel-composition-patterns

Guide React component composition with explicit variants and compound components.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pattern-driven guidance to reduce boolean prop proliferation by advocating compound components and context-driven APIs. It explains how to structure explicit variants, lift state into providers, and craft reusable UI libraries.

Core Features & Use Cases

  • Reusable component architecture using compound components and shared context
  • State lifting and provider-based sharing across UI boundaries
  • Explicit variant components to avoid a combinatorial explosion of boolean props
  • Real-world scenarios include refactoring large React apps, building design systems, and creating scalable UI APIs.

Quick Start

Identify an existing UI component with boolean props and refactor it into explicit variant components by composing the provided primitives.

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, refactor components into explicit variant components and use compound component patterns to avoid combinatorial prop explosions. This approach separates UI structure from state implementation for better maintainability.

What is the best way to manage state across large React component libraries?

The best way to manage state across large React component libraries is by lifting state into providers and using dependency-injected state sharing. This ensures clear separation between UI and state implementation across UI boundaries.

How do compound components help build scalable React design systems?

Compound components help build scalable React design systems by enabling reusable component architecture through shared context. This pattern allows teams to compose primitives into explicit variants, preventing boolean prop combinations from exploding.

Can I use React 19 APIs for context and ref handling in composition patterns?

Yes, you can use modern React 19 APIs for ref handling and context usage within composition patterns. These APIs support provider-based state sharing and compound component structures when refactoring large UI systems.

When should I refactor a React UI component into explicit variants?

You should refactor a React UI component into explicit variants when boolean props cause a combinatorial explosion of conditional logic. Converting these props into explicit variant components restores maintainability and clarifies the component architecture.