News for hackers. Stuff that matters.
Re:Clay – UI Layout Library by citizenpaul on Friday December 20, 2024 @12:45PM (#42473138)
I'm not a frontend person. Can anyone explain why this is better than using CSS directly or a CSS framework/library? Seems like added complexity when there are already hundreds of CSS frameworks available that seem like they do the same thing.
Re:Clay – UI Layout Library by mdarens on Friday December 20, 2024 @02:48PM (#42474326)
This isn't really meant to replace such things an environment where you have a rendering engine that supports CSS— I think demoing it on the page is more for showing off how portable it is with WASM. Off the top of my head, a few uses for this:

- Mapping components or structured document data with something like MDX or slate on to Clay components to render in different contexts outside the browser reasonably closely to what shows up in a browser preview, for example content for HUDs, in-world display panels or documents in games, or batch rendering printed documents

- Layout for UI where something like Electron or React Native would be overkill, or isn't supported

Re:Clay – UI Layout Library by hoppp on Friday December 20, 2024 @12:56PM (#42473214)
Maybe you want the compile some C to wasm and render to canvas. Then it's pretty neat.
Re:Clay – UI Layout Library by tenken on Friday December 20, 2024 @10:44PM (#42477400)
This UI library can be re-targeted to Raylib, Canvas, HTML from its markup ... Good luck doing that with just CSS.

Put another way, this library is a step into writing an agnostic UI layer for your application which it just invokes from its business logic. If you can decouple your UI from your application code ala MVC or MVP architecture, as a developer you can find the right tool for the components that compose the sum of your project.

Re:Clay – UI Layout Library by corysama on Saturday December 21, 2024 @11:11AM (#42480440)
The main goal is to enable nice UI without the requirement of a whole web browser in order to get CSS. The fact that it can be used to layout web pages is just showing off to get the attention of the billion web devs out there.