ZigZag - A TUI framework for Zig

Hey everyone! I just released v0.1.0 of ZigZag, a TUI framework inspired by Go’s Bubble Tea and Lipgloss.

I built this because I wanted a nice way to build terminal UIs in Zig without reaching for C libraries or bindings.

Features:

  • Elm-inspired architecture (Model-View-Update)

  • Flexbox-like layouts

  • Styling (colors, borders, padding, etc.)

  • Input handling

Repo: https://github.com/meszmate/zigzag

Still early days, feedback and contributions welcome!

37 Likes

Are you going to update the project or its just as it is right now? Update I mean by updating to the newest zig 0.16.0 in the future.

Yep, actively maintained! I’ll keep it updated with new Zig releases.

3 Likes

Elm thinking is great

1 Like

This is really cool! I’ve been on the lookout for something like this.

1 Like

Awesome project, I look forward to using it.

1 Like

How lovely is this! Impressed.

2 Likes

First patch release! Mostly focused on fixes and laying groundwork.

What’s new:

  • Custom event loop support: you can now bring your own event loop instead of relying on the built-in one

  • Unicode support (+ a unicode tab in the showcase to play with)

Fixes:

  • Windows compilation is working now

  • Terminal state properly restores on exit (no more messed up terminals)

4 Likes

I’ve been looking though the code, has AI been used in this project?

Yeah, used AI for parts of it.

1 Like

Hey! I’ve been using bubbletea a lot, and the similarity makes me wonder if you started this project by asking a LLM to translate bubbletea to zig. Is it the case ? If so, did you test extensively the resulting code ?

Bubbletea was a big inspiration for the architecture, yeah. I used LLMs as a tool during development like I do with most projects nowadays, but it’s not a translation. Zig requires a very different approach to memory management, error handling, etc. And yes, everything is tested and properly maintained.

8 Likes