compound-pattern

Coordinate related UI subcomponents by sharing implicit state without prop drilling.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/thinkeloquent/mta-ui-atomicdesign-organisms --skill compound-pattern-thinkeloquent
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compound-pattern
Source: https://github.com/thinkeloquent/mta-ui-atomicdesign-organisms/tree/main/.agents/skills/compound-pattern
Command: npx skills add https://github.com/thinkeloquent/mta-ui-atomicdesign-organisms --skill compound-pattern-thinkeloquent

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Coordinate related UI subcomponents by sharing implicit state, enabling coordinated behavior without prop drilling, and simplifying complex component trees.

Core Features & Use Cases

  • Shared state management using React Context or static property composition to connect parent and child components
  • Expose child components (e.g., FlyOut.Toggle, FlyOut.List, FlyOut.Item) as properties on the parent
  • Flexible approaches: context-based coordination or prop-augmentation via cloning for nested structures
  • Use Cases: menus, dropdowns, tabs, or any compound widget with coordinated sub-components

Quick Start

Create a parent component that manages shared state and expose child components as static properties to compose coordinated UI.

Frequently Asked Questions about compound-pattern

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

FAQPage Schema
How do I build a dropdown menu in React using shared state?

To build a dropdown menu with shared state, create a parent component that manages the menu's open state and expose child elements like Toggle, List, and Item as static properties. This allows the subcomponents to coordinate implicitly without prop drilling.

Does the compound pattern work with React Context or static properties?

The compound pattern supports both React Context for safe state propagation and static property composition on the parent component. You can also use prop-augmentation via cloning for nested structures to achieve coordinated subcomponents.

When should I avoid using the compound pattern for UI components?

You should avoid the compound pattern when your UI components do not require coordinated behavior or shared implicit state. If your component tree is simple enough that prop drilling is manageable, introducing context or static properties may add unnecessary complexity.

What's the best way to structure composite widgets like tabs in React?

The best way to structure composite widgets like tabs is using the compound pattern to share implicit state. A parent component holds the active tab state, while child components are exposed as static properties to coordinate seamlessly without explicit prop passing.