Knots - A library for building GUIs with Zig

Just wanted to post some updates here for people interested:

  • Playground web build is now hosted on codeberg pages, here: Playground
    • Web wasm build is down to 1.93 MB (900KB compressed), with about 400KB of the uncompressed data being just the font ttf. I want to get this even lower, potentially by dropping emcc as a build dependency, but will require some work to support wasm-freestanding as a target currently.
  • Some new components added
    • Color picker
    • Checkbox
    • Multi-line text input
    • Virtual list
    • General improvements to all existing components
  • The theme system got some upgrades, the theme can now be defined as a .zon file, an also changed at runtime. Themes are checked at compile theme for errors (invalid hex, rgba e.t.c). You can view the existing ones that come with knots here https://codeberg.org/shahwali/knots/src/branch/main/src/ui/themes
  • The vulkan backend vertex shaders are now written in Zig, and compiled using Zig, I wrote about it here: Writing Compute Shaders In/With Zig - #13 by shahwali
  • Text word wrapping added.
  • Grid layout support added.
  • The renderer settings/dev tools got an upgrade, now with some more stats, and even a sparklines graph!

Still so much to do…, below is a screenshot of as much I could possibly pack in one frame on the playground app. Would like to write some docs when I have time, mostly to free up some space in my head but also if anyone else is willing to try knots out, at your own risk of course.

21 Likes