andlabs/libui logo

andlabs/libui

Free

Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.

FreeFree tier
Type
Open Source

About andlabs/libui

libui is a lightweight, portable GUI library written in C that leverages the native GUI technologies of each supported platform (Windows, macOS, and Unix/Linux). It aims to provide a simple yet flexible API for building graphical desktop applications without sacrificing native look and feel. Currently in mid-alpha development, libui is stable enough for small programs and examples but lacks many planned features such as tree views, clipboard support, drag and drop, advanced dialogs, printing, accessibility, OpenGL integration, and full documentation. The library uses Meson as its build system and is released as open-source software (MIT license). It is actively maintained by the author (andlabs) but remains a work-in-progress.

Key Features

Portable C library for native GUI applications
Uses native GUI technologies of Windows, macOS, and Unix (Linux)
Simple and flexible API design
Open source with MIT license
Meson build system support
Includes example programs and test suite

Pros & Cons

Pros
  • Native look and feel on all major platforms
  • Lightweight and simple API
  • No heavy dependencies beyond standard platform libraries
  • Open source and community-driven
  • Actively maintained with regular updates
Cons
  • Mid-alpha status: not feature-complete or fully stable
  • Lacks many features like trees, clipboard, drag and drop, advanced dialogs, printing, accessibility, OpenGL
  • Documentation is incomplete; users may need to refer to headers or Go bindings
  • Some parts buggy on certain platforms
  • Not recommended for production use yet

Best For

Building cross-platform desktop applications in CCreating small native GUI tools and utilitiesEducational use for learning GUI programming with native toolkitsEmbedded GUI development for systems requiring minimal dependencies

FAQ

What is the current development status of libui?
libui is currently in mid-alpha. It is stable enough for example programs and small applications, but it is not feature-complete and may have bugs on some platforms. Missing features include trees, clipboard, drag and drop, better dialogs, printing, accessibility, and OpenGL support.
Which platforms does libui support?
libui supports Windows, macOS, and Unix/Linux by using the native GUI technologies of each platform (Win32, Cocoa, and GTK+ respectively).
Is libui properly documented?
Documentation is incomplete. The main API header (ui.h) contains comments for some parts, but a full documentation is still in progress. Users can also refer to the documentation for libui's Go bindings as a reference, though it is somewhat stale.
How can I build libui?
libui uses the Meson build system. Instructions for building are provided in the repository's README. The build system was switched from CMake to Meson to resolve prior issues.