compound component

A set of components designed to be used together, such as Tabs, Tabs.Trigger and Tabs.Panel, that share state behind the scenes.

In more detail

The root holds the state and provides it through React Context; each part reads what it needs. Consumers arrange the parts freely without wiring state themselves. Parts should throw a clear error if used outside their root, and the root should generate unique IDs so several instances on one page do not collide.

Related terms

Taught in

References