A native, GPU-rendered Rust UI framework for macOS, Windows, Linux and the web, with its own renderer, text, layout and springs.
justrach/nanoui
A Zig toolkit for building desktop apps with native UI drawn on the GPU, or with a web page in the system webview.
- Stars
- 862
- Forks
- 45
- Open issues
- 5
- Last commit
- 5 hours ago
What is it?
nanoui is a toolkit for writing desktop applications in Zig. Each window can show either a native interface written entirely in Zig and drawn by nanoui, with no HTML or webview, or a web page rendered in the system webview (WKWebView on macOS, WebView2 on Windows) whose frontend calls Zig through a generated, typed JavaScript client.
The native UI uses flexbox-style layout, text rendering from a glyph atlas, animations, and immediate-mode views that can be tested without opening a window. On macOS it draws with Metal and CoreText. Linux and Windows are also supported, along with iOS and Android. Apps compile to single binaries.
The project includes a `nui` command-line tool that scaffolds a new app, runs its tests offscreen, and captures snapshots as PNG files, which suits both developers and coding agents.
Key features
- 01Native UI written in Zig, drawn on the GPU with Metal on macOS
- 02Flexbox layout, virtualized lists, text wrapping and rich text
- 03Web pages in the system webview with a generated, typed JavaScript client
- 04Headless testing and PNG snapshots without opening a window
- 05Single-binary apps, with a release build around 0.7 MB
- 06Runs on macOS, Linux, Windows, iOS and Android
Use cases
- Building small, fast desktop utilities in Zig without a browser engine
- Writing a native-feeling app whose UI is tested headlessly in CI
- Shipping a Zig backend with a web frontend in the system webview
- Prototyping an iOS or Android app in Zig with shared view code
Quick start
- 1
Clone the repository with submodules
git clone --recursive https://github.com/justrach/nanoui - 2
Enter the project directory
cd nanoui - 3
Run the native UI gallery example
zig build run-gallery - 4
Run the webview example
zig build run-hello
Things to know
- Requires Zig 0.17.0, which is a specific pre-1.0 toolchain version.
- While nanoui is 0.x, minor releases may change the API.
- Linux apps need GTK 3 at run time.
In collections
Topics
FAQ
- What is nanoui?
- A Zig toolkit for building desktop apps with native UI drawn on the GPU, or with a web page in the system webview. nanoui is a toolkit for writing desktop applications in Zig. Each window can show either a native interface written entirely in Zig and drawn by nanoui, with no HTML or webview, or a web page rendered in the system webview (WKWebView on macOS, WebView2 on Windows) whose frontend calls Zig through a generated, typed JavaScript client.
- Is nanoui free to use? What license does it have?
- nanoui is open source under the MIT license. Check the license terms before using it in commercial products.
- Is nanoui still maintained?
- Actively maintained. The last commit to nanoui was on Nov 7, 2026.
- What can I use nanoui for?
- Building small, fast desktop utilities in Zig without a browser engine Writing a native-feeling app whose UI is tested headlessly in CI Shipping a Zig backend with a web frontend in the system webview Prototyping an iOS or Android app in Zig with shared view code
- How do I install nanoui?
- Clone the repository with submodules: git clone --recursive https://github.com/justrach/nanoui Enter the project directory: cd nanoui Run the native UI gallery example: zig build run-gallery Run the webview example: zig build run-hello
- Where can I get nanoui?
- The source code and installation instructions are on GitHub: https://github.com/justrach/nanoui
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A Go framework for building cross-platform desktop apps with a web frontend (React, Vue, Svelte, etc.) using native rendering engines.
A Go framework for building desktop apps with either a web frontend in the OS webview or a native UI drawn on the GPU.
A tiny C/C++ library that embeds a native web view in desktop apps, using WebKit on Linux and macOS and WebView2 on Windows.
A Rust framework and studio app for building native and web apps and games with a GPU-accelerated UI runtime and live-editable UI DSL.
Open-source Python framework for building GUI apps that run on desktop, mobile and embedded platforms from one codebase.