golang-ui/nuklear logo

golang-ui/nuklear

Free

This project provides Go bindings for nuklear.h — a small ANSI C GUI library.

FreeFree tier
Type
Open Source

About golang-ui/nuklear

Nuklear is a Go binding for nuklear.h, a minimal state immediate mode graphical user interface toolkit written in ANSI C. It provides a small, portable, and efficient GUI solution for Go applications with no external dependencies. The bindings are automatically generated from C source and support multiple platforms including Windows, macOS, Linux, and Android via GLFW or SDL2 backends. Nuklear features a fully skinnable interface, UTF-8 support, low memory footprint, and optional font baking. It is designed to be embedded directly into applications, handling layout and input while leaving rendering to the host program.

Key Features

Immediate mode graphical user interface toolkit
Single header library written in C89 (ANSI C)
Small codebase (~15kLOC) with focus on portability, efficiency, and simplicity
No dependencies (standard library not required)
Fully skinnable and customizable UI
Low memory footprint with optional total memory control
UTF-8 support
No global or hidden state
Customizable library modules (compile only what you need)
Optional font baker and vertex buffer output

Pros & Cons

Pros
  • Immediate mode paradigm simplifies UI state management
  • Very small footprint and no heavy dependencies
  • Portable across major desktop and mobile platforms
  • Full skinning and customization support
  • UTF-8 text handling built-in
  • Low memory and CPU overhead
  • C89 compatibility ensures wide compiler support
Cons
  • Thin Go bindings only; no idiomatic Go wrapper yet
  • Requires some familiarity with C API and immediate mode patterns
  • No high-level widget library; only primitive UI elements
  • Documentation may be sparse for Go-specific usage
  • Rendering backend must be implemented or integrated separately

Best For

Building lightweight desktop GUI applications in GoEmbedding a GUI in games or real-time applicationsPrototyping cross-platform user interfaces with minimal overheadCreating configuration tools, debug panels, or editorsEducational projects for learning immediate mode UI concepts

FAQ

What is nuklear?
Nuklear is a minimal state immediate mode GUI toolkit written in ANSI C. It is a single header library with no dependencies, focused on portability, efficiency, and simplicity.
How do I install the Go bindings?
Use `go get github.com/golang-ui/nuklear/nk`. On Linux, ensure you have the required development headers (e.g., xorg-dev on Debian/Ubuntu, libX11-devel on Fedora) for GLFW.
Which platforms are supported?
Desktop: Windows (32/64-bit), macOS, Linux. Mobile: Android. Desktop uses GLFW or SDL2; Android uses the android-go project with OpenGL ES.
Does nuklear require a specific rendering backend?
No. Nuklear outputs draw commands that can be consumed by any rendering backend. The Go bindings include sample backends for OpenGL 2.1 and 3.2 on desktop and OpenGL ES on Android.