Live data from Hacker News

Clay – UI Layout Library

nicbarker.com

41–50 of 95 posts

Re: Clay – UI Layout Library

#42

Nice! It's pretty cool what you can make in a few thousand lines. Though Flex isn't my favorite as I prefer full CSS Grid. So I ended up making a CSS Grid layout library that I'm proud of in pure Nim (1). Though I'll have to checkout Clay and compare some of the layout algorithms. It's neat to see boxes resizing themselves using an algorithm you implemented. Wonder if I could expose a C interface? The reason I like C…

Cool! I also have a standalone implementation of CSS Grid [1]. Implemented in Rust in my case (and we also support Flexbox and Block layout). Looks like the licenses are both MIT (although you may want to add a LICENSE file to make that easier to find) so feel free to steal bits if you want. We aim to be fully web compatible, although we're not quite there yet. One thing we have that you may be particularly intereste…

Hey thanks! That's awesome and great to see other implementations. Figuring out test cases is half the battle and I've really only done the basics. I'll definitely look to stealing things. ;)

> Looks like the licenses are both MIT (although you may want to add a LICENSE file to make that easier to find) so feel free to steal bits if you want.

Good call, I'll add the license file.

Re: Clay – UI Layout Library

#43
post #19

Earlier quoted context omitted.

I'm a gray beard like you probably but I disagree with this statement. This library makes use of modern composable components, is declarative driven and not imperative; and doesn't do immediate rendering in all cases. It can target incredibly different backends, e.g. DOM/canvas/raylib. All of this in modern C as a `.h` library alone. These are great features and not just a 'youngster discovers' project.

Maybe a README that shows how it works and what it does would help. As it is it is quite opaque IMO, with just a few high level comments.

It's in the repo; landing pages are usually for generating interest.

https://github.com/nicbarker/clay

Re: Clay – UI Layout Library

#44

Just a funny note—there’s a button at the end to switch between HTML and Canvas. I think it is neat how little difference it makes… normally. But with iOS Safari + Dark Reader, at least on my side, the HTML page is turned into dark mode with Dark Reader, while the canvas page is not. So, it basically ruins the wow factor, haha. But it still looks nice.

Text selection and zoomng is also problematic.

Zooming is indeed an issue but selection works fine for me on safari ios.

Re: Clay – UI Layout Library

#46
post #16

Earlier quoted context omitted.

If you don't use some kind of layouting language (like XML/HTML), this is inevitably what you will always end up with. See: AWT[1], SWT[2], Swing[3], Qt[4]†, Fyne[5], etc., etc., etc. [1] https://docs.oracle.com/javase/7/docs/api/java/awt/GridLayou... [2] https://github.com/eclipse-platform/eclipse.platform.swt/blo... [3] https://stackoverflow.com/a/12867862/243613 [4] https://stackoverflow.com/questions/37304684/qwi…

Qt has uic xml layout engine which was cumbersome to use, you weren’t discouraged from using c++ classes instead. The discouragement came later when Qt shifted towards qml (a bad shift as it’s just as unweildly, imo), now they discourage writing qml in c++ because the qml engine can get out of sync. Qt can prevent this but they want you to pay for a premium license for it. Slint is a sister to qt that does not have t…

Agreed that a C++ API for qml would be great. qml by itself is great though, I don't see why it is unweildy. If anything it's unpolished, there is stuff that is more difficult than it should be, but it's miles ahead of what there was before imo.

Re: Clay – UI Layout Library

#47
post #19

Earlier quoted context omitted.

I'm a gray beard like you probably but I disagree with this statement. This library makes use of modern composable components, is declarative driven and not imperative; and doesn't do immediate rendering in all cases. It can target incredibly different backends, e.g. DOM/canvas/raylib. All of this in modern C as a `.h` library alone. These are great features and not just a 'youngster discovers' project.

Maybe a README that shows how it works and what it does would help. As it is it is quite opaque IMO, with just a few high level comments.

[deleted]

Re: Clay – UI Layout Library

#49
post #19

Earlier quoted context omitted.

I'm a gray beard like you probably but I disagree with this statement. This library makes use of modern composable components, is declarative driven and not imperative; and doesn't do immediate rendering in all cases. It can target incredibly different backends, e.g. DOM/canvas/raylib. All of this in modern C as a `.h` library alone. These are great features and not just a 'youngster discovers' project.

Maybe a README that shows how it works and what it does would help. As it is it is quite opaque IMO, with just a few high level comments.

The README for the project is one of the most detailed READMEs I’ve ever seen. The landing page for the website has as much detail as you can reasonably expect, even including a couple of feature demos. There are clear links to the docs and the code.

The developer has clearly put a lot of thought into this content. Worth taking a second or two to see what’s available before criticising it.

Re: Clay – UI Layout Library

#50

Earlier quoted context omitted.

Text selection and zoomng is also problematic.

Zooming is indeed an issue but selection works fine for me on safari ios.

On Windows/Firefox, text selection doesn't work. Also not working is Home/End and wheel click scrolling. Cool project otherwise.
Post reply on HN