DEV Community

Discussion on: The Sexiness of Headless UI Components

Collapse
 
jwp profile image
John Peters • Edited

Yes, reusable small parts that allows the consumer to inject behavoir. This is SRP (Single Responsibility Pattern) and OOP (Object Oriented Programming) done properly.

It's also using the Functional Style while sticking to SRP.

It shows why good OOP winds up using Functional techniques anyway.

It's also using Dependency Injection by being able to render any layout injected into your component.

Truely an excellent example of good programming technique.

If this were Angular, we'd use the ng-container markup in HTML instead of the children props shown above