explaingit

andlabs/libui

10,880CAudience · developerComplexity · 4/5Setup · hard

TLDR

A C library for building desktop apps that look and behave natively on Windows, macOS, and Linux by using each OS's own built-in controls, buttons, menus, dialogs, and more, rather than drawing fake ones. Currently mid-alpha.

Mindmap

mindmap
  root((libui))
    What it does
      Native GUI in C
      Uses real OS controls
      Cross-platform
    Supported controls
      Buttons and text inputs
      Dialogs and menus
      Drawing area
    Current limits
      Mid-alpha status
      No clipboard support
      No drag-and-drop
    Audience
      C developers
      Systems programmers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build a small cross-platform desktop utility in C that uses real native controls on Windows, macOS, and Linux without three separate codebases.

USE CASE 2

Add a native-looking file dialog, progress bar, or settings form to an existing C program.

USE CASE 3

Create a Go desktop app with native OS controls using libui's Go language bindings.

Tech stack

CMeson

Getting it running

Difficulty · hard Time to first run · 1h+

Mid-alpha: API is still changing, documentation is partial, and key features like clipboard, drag-and-drop, and accessibility are not yet implemented.

In plain English

libui is a library that lets programmers build graphical user interfaces (windows, buttons, menus, text fields, and so on) in C, with the result looking and behaving natively on Windows, macOS, and Linux. Rather than drawing every pixel itself, the library calls each operating system's own built-in interface toolkit, so apps built with it use the same controls that users already see in their system's native applications. The goal is for programs to not just look native but to actually be native at the control level. The library is written in C and is designed to be portable and straightforward to use. It supports a range of common controls: single-line and multi-line text inputs, buttons, checkboxes, radio buttons, dropdowns, sliders, progress bars, date and time pickers, tabs, menus, file and folder dialogs, and a drawing area for custom graphics. A formatted text API allows displaying styled text with different fonts, colors, and sizes. As of the last update in the README, libui is in mid-alpha status. The author is clear that it is not yet feature-complete or fully stable. Several things are explicitly missing or incomplete, including clipboard and drag-and-drop support, printing, accessibility features for the drawing area, OpenGL rendering, and deeper OS integration for document-based applications. The API is still settling down and documentation is partial. The build system is Meson (switched from CMake in April 2019). Bindings exist for other languages including Go, and the README points to the Go documentation as a partial reference. The project is still being actively worked on but has slowed, the README notes it is not dead, just progressing gradually.

Copy-paste prompts

Prompt 1
Using libui in C, create a window with a text input, a button, and a message dialog that appears when the button is clicked.
Prompt 2
How do I add a menu bar with File and Edit menus to a libui application that works on all three platforms?
Prompt 3
Set up the libui build system with Meson on Ubuntu and compile a Hello World GUI app in C.
Prompt 4
What controls does libui currently support, and what features like clipboard or drag-and-drop are still missing?
Prompt 5
Show me how to draw custom graphics inside a libui drawing area using the 2D drawing API.
Open on GitHub → Explain another repo

← andlabs on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.