component-composition

Implement React component composition patterns with children, slots, and render props.

22|3|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/fusengine/agents --skill component-composition-fusengine
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: component-composition
Source: https://github.com/fusengine/agents/tree/main/plugins/design-expert/skills/component-composition
Command: npx skills add https://github.com/fusengine/agents --skill component-composition-fusengine

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers understand and implement various patterns for building reusable and maintainable React components, ensuring efficient UI development.

Core Features & Use Cases

  • Component Structure: Learn to use children, slots, and compound components for flexible UI.
  • API Design: Implement render props and polymorphic components for advanced customization.
  • Use Case: When building a complex UI element like a modal or a card, this Skill guides you on how to structure its internal components for maximum reusability and clarity.

Quick Start

Use the component-composition skill to implement the slots pattern for a reusable card component.

Frequently Asked Questions about component-composition

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

FAQPage Schema
How do I structure reusable React components using slots and children?

React component composition uses children and slots to structure flexible UI elements. This pattern separates container logic from presentation, enabling maximum reusability when building complex components like modals or cards.

What are compound components in React and when should I use them?

Compound components in React group related sub-components together to share implicit state. Use this composition pattern when building complex UI elements like modals or cards that require tight internal coordination while remaining flexible for consumers.

How do I implement render props for advanced React component customization?

Render props in React implement advanced API design by passing a function as a prop to control component rendering. This pattern provides maximum customization flexibility, allowing parent components to inject dynamic logic into reusable UI elements.

Do I need TypeScript to build polymorphic React components?

TypeScript is required to ensure type safety when building polymorphic React components. Understanding React's core concepts alongside TypeScript allows you to create flexible, maintainable UI elements that safely support dynamic component prop typing.

What's the best way to create maintainable React UI elements for complex layouts?

The best way to create maintainable React UI elements is through advanced composition patterns like slots, compound components, and render props. These techniques decouple internal structure from external usage, ensuring efficient and clear UI development.