CUI – Native UI components for C

hilti 171 points 92 comments November 09, 2026
yappologistic.github.io · View on Hacker News

Discussion Highlights (20 comments)

saidnooneever

this looks really sweet actually. didnt dig into the backing code yet but the examples look really nice and clean to implement a UI with. well done.

all2

The acronym collision is entertaining. I now want to use CUI to mark up my CUI.

wg0

Looks like ShadCN. That too in C. It's really really elegant. EDIT: It's immediate mode.

piker

C increasingly makes sense for compile times if you can have a separate Fable pass on memory safety, etc.

skydhash

This looks like built by someone raised exclusively on web and touch technologies, forgetting that both are the results of constraints. The web was not meant to be a UI platforms and have poor primitives, and touch devices lack precise positioning and a physical keyboard. Take the chips and rating as an example https://yappologistic.github.io/CUI/#/c/chips-and-rating It’s purely aesthetic as functionality (and ux) wise, chips are not different from checkbox with labels and rating is just a discrete slider. And as I thought, you can see the duplicate code for switch and checkbox here. https://github.com/yappologistic/CUI/blob/f1202e6d98cdc297f9... People do need to differentiate between UX primitives and something that just looks different.

cincinnatus

Shame to put effort into encouraging more C code. All C code needs to be torn out by the roots. I don't care how carefully crafted it is and how many Fable passes have been done, it is inherently unsafe.

nepthar

Okay, so this is cool, but also vibecoded by someone who just does frontend. I totally support AI development, but the first commit was 4 days ago and it's entirely written by claude. The UI looks like "the style that that AI comes up with" turned into a C framework. I don't want to discourage this kind of experimentation, but I also question how much of the last 20+ years of UI and C knowledge was not used in the construction of this project. Also, do I want to build a kanban board in C? Unsure. Just take care when evaluating this for actual usage.

CrzyLngPwd

Looks lovely, but without long term support and hostory, I wouldn't touch it with someone else's long stick.

zerr

Can you please prompt your agent to generate a C++ binding?

annoyingnoob

CUI - Controlled Unclassified Information.

zerr

More like custom UI components. Native would have been if you had wrapped e.g. Cocoa NSButton on macOS and Microsoft.UI.Xaml.Controls.Button on WinUI.

huhtenberg

Any pre-built examples? Even if it's something like a calculator.

Luke2642

Looks great, but node editor is janky on mobile.

dvt

So funny seeing these kinds of frameworks being vibe-coded. I can tell the author has never used the zillions of frameworks the LLM was trained on. Writing (and maintaining) this kind of code is absolute nightmare fuel. bool narrow = cui_viewport_size(ui).x < 760; cui_row(ui, .width = CUI_FILL, .height = CUI_FILL, .align = CUI_ALIGN_STRETCH) { if (!narrow) { sidebar(ui, s); cui_separator(ui); } content(ui, s, narrow); /* a menu button opens the drawer when narrow */ } cui_sheet(ui, "Menu", &s->drawer, .side = CUI_SIDE_LEFT, .size = 280) { nav(ui, s); } There's a reason QT uses XML for their layouting, there's a reason people prefer Tauri + Vue/React, there's a reason Swift uses declarative paradigms in all their UI code. It's not that you can't build good UI frameworks in low-level languages; for example, I think Go's Fyne[1] is a pleasure to use. But people actually used their brains when designing that framework, as opposed to "hey Claude build a UI framework in C, make no mistakes." [1] https://fyne.io/

kettlez

Clearly vibecoded, but it looks really nice. The widget id generation seems pretty naive, I wonder how well it handles dynamic UIs.

MomsAVoxell

You know what this needs now? A Lua REPL.

pearcoder

Since AI has removed the bottleneck of writing code, so I understand why not go directly C. This could bite back sooner or later.

brabel

This is amazing, finally a good looking UI framework for a low level language! I will be looking at this next time I need a little UI, since it's nice when you can make an app that has a UI and it's distributed in much, much less than 1MB rather than 300MB as most Electron apps.

turtlebits

We need a HN min-release-age flag for posted projects. Or some flag to ignore users that post these types of projects often.

apitman

Since most of my code for work is AI-generated now, I recently started a small side project in part to continue practicing coding by hand, and decided to use C. There's something nice about using a language that's simple enough that I could write/maintain my own compiler if I really had to. I'm really curious how secure C software would be if reviewed by AI and run exclusively in a WASM runtime.

Semantic search powered by Rivestack pgvector
12,324 stories · 116,709 chunks indexed