react-composition-2026

Teaches modern React composition patterns for designing flexible component APIs and refactoring prop-heavy components.

1|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/TierOne-Studio/spa-velocity --skill react-composition-2026-tierone-studio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-composition-2026
Source: https://github.com/TierOne-Studio/spa-velocity/tree/main/.ruler/skills/react-composition-2026
Command: npx skills add https://github.com/TierOne-Studio/spa-velocity --skill react-composition-2026-tierone-studio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React components often accumulate boolean props, rigid mode switches, and tangled state that make them hard to extend, test, and review. This Skill provides concrete composition patterns that replace prop proliferation with explicit, composable component designs. ## Core Features & Use Cases - Boolean Prop Elimination: Replace combinatorial boolean props with compound components and explicit sub-components like Card.Header and Card.Body. - Compound Components with Context: Build component groups (Select, DataTable) that share implicit state through context instead of prop drilling. - Modern React 19 Patterns: Apply ref-as-prop instead of forwardRef, the use() hook, polymorphic as props, slot patterns, and headless components. - Use Case: When reviewing a shared UI library where a Select component has 8+ configuration props, use this Skill to refactor it into Select.Trigger, Select.Options, and Select.Option sub-components with context-based state. ## Quick Start Review this component file and refactor its boolean props into a compound component pattern using context.

Frequently Asked Questions about react-composition-2026

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

FAQPage Schema
How do I replace boolean props in React components?

Replace boolean props with composition by splitting the component into explicit sub-components like Card.Header, Card.Body, and Card.Footer. Each piece becomes independently optional and testable, avoiding the combinatorial explosion that boolean props create.

What is the compound component pattern in React?

Compound components are a group of components that share state through React context instead of props. A parent component like Select owns the state and provides it via context, while children like Select.Trigger and Select.Option consume it.

Does React 19 still require forwardRef?

No, React 19 passes ref as a regular prop, so function components can accept ref directly in their props without the forwardRef wrapper. The use() hook can also read promises or context conditionally.

When should I use render props instead of children?

Reserve render props for cases where the parent must provide data to the renderer, such as virtualized list items. For most composition scenarios, children composition with sub-components produces a simpler and more readable API.

What are headless components in React?

Headless components provide behavior such as state, keyboard handling, and ARIA attributes without any markup, letting consumers control all rendering. Libraries like Radix UI, Headless UI, and React Aria follow this pattern.