Compound components offer flexibility in component composition but aren't always the right choice. They work best for static content with dynamic layouts (like RadioGroups or ButtonGroups), not for fixed layouts or dynamic content (like Selects). For type safety, use a component factory pattern: export a function like

8m read time From tkdodo.eu
Post cover image
Table of contents
A Bad ExampleSlotsA Better ExampleType Safety

Sort: