composition-pattern

Community

Flexible, consumer-driven UI component design

AuthorBrunoAMSilva
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Many UI components become rigid and hard to reuse when they expose numerous configuration props for content; this Skill advocates accepting dynamic content so consumers control composition, improving flexibility and extensibility across use sites.

Core Features & Use Cases

  • Children and Slots Over Props: Prefer default children and named slots instead of enumerating content props to avoid prop explosion and make components adaptable.
  • Named Slots & Compound Components: Support multiple distinct content regions and related subcomponents that share implicit state via context or provide/inject for cohesive APIs.
  • Headless & Polymorphic Patterns: Separate behavior from styling so consumers can supply UI, and allow as/tag polymorphism so the same component can render different semantic elements.
  • Use Case: Build a Card, Modal, or Tabs system where consumers supply header, body, and footer content or attach compound subcomponents without changing the parent API.

Quick Start

Implement a Card component that accepts default children for body, named slots or props for header and footer, shares state through context for compound subcomponents, and exposes headless hooks plus an as/tag prop for polymorphic rendering.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 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: composition-pattern
Download link: https://github.com/BrunoAMSilva/my-config/archive/main.zip#composition-pattern

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.