Compound Pattern

Expert guide for designing and implementing the Compound Component pattern in React. Use this skill whenever the user wants to build reusable UI components that share state internally (menus, dropdowns, tabs, accordions, modals, data tables, lists), when they ask how to avoid prop drilling or "God component" anti-patterns, when they want to build a component library with a clean declarative API, or when they mention compound components, Context API for component composition, React.Children, or cloneElement. Trigger even if the user just describes a component with sub-parts that need to communicate (e.g. "tabs with active state", "dropdown with a trigger and list", "table with rows and cells").

alexeira 890ed54 10.0 KB Updated

File contents

alexeira/skills/tree/main/compound-pattern commit 890ed541f2

Frequently asked questions

npx skillmds@latest add alexeira/compound-pattern