component-composition
CommunityBuild flexible UIs with React 19 composition patterns.
Software Engineering#react#reusable components#compound components#component composition#render props#react 19#prop drilling
Authordjankies
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Designing reusable and flexible component APIs without prop drilling or tight coupling can be challenging. This Skill teaches effective composition patterns to create maintainable and adaptable React UIs.
Core Features & Use Cases
- Children Prop: The simplest form of composition for content containment.
- Compound Components: Build components that work together (e.g., Tabs, Accordion) using React Context for coordinated behavior.
- Render Props: Pass functions as children to provide custom rendering logic and share behavior.
- Composition over Props: Prefer slots and composition over complex configuration props for greater flexibility.
- Use Case: Refactor an existing
Modalcomponent to use compound components (Modal.Header,Modal.Body,Modal.Footer) for better flexibility and reusability, allowing consumers to define the modal's structure.
Quick Start
Refactor the Card component in src/components/Card.js to use the children prop for its main content, and separate header and footer props for optional slots.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: component-composition Download link: https://github.com/djankies/claude-configs/archive/main.zip#component-composition Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.