Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
N

Nuklear

> 数据库
Open source

A single-header ANSI C immediate mode cross-platform GUI library

11.3K stars0 likes1 views
WebsiteGitHub

About

A single-header ANSI C immediate mode cross-platform GUI library

Nuklear

This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.

Features

  • Immediate-mode graphical user interface toolkit
  • Single-header library
  • Written in C89 (ANSI C)
  • Small codebase (~18kLOC)
  • Focus on portability, efficiency and simplicity
  • No dependencies (not even the standard library if not wanted)
  • Fully skinnable and customizable
  • Low memory footprint with total control of memory usage if needed / wanted
  • UTF-8 support
  • No global or hidden state
  • Customizable library modules (you can compile and use only what you need)
  • Optional font baker and vertex buffer output
  • Documentation

Usage

This library is self-contained in one single header file and can be used either in header-only mode or in implementation mode. The header-only mode is used by default when included and allows including this header in other headers and does not contain the actual implementation.

The implementation mode requires defining the preprocessor macro NK_IMPLEMENTATION in one .c/.cpp file before #includeing this file, e.g.:

c
#define NK_IMPLEMENTATION
#include "nuklear.h"

IMPORTANT: Every time you include "nuklear.h" you have to define the same optional flags. This is very important; not doing it either leads to compiler errors, or even worse, stack corruptions.

Gallery

Example

The example below shows the general structure of a Nuklear application: one-time setup, then once per frame mirror the input, build the user interface and draw it. Nuklear does no rendering itself, so the parts marked your_... are provided by your rendering backend:

…

Ready-to-use rendering backends for GLFW, SDL, X11, GDI, Direct3D, Vulkan and more are in the demo folder, each with its own build instructions, e.g.:

bash
make -C demo/glfw_opengl3

More complete programs can be found in the example folder. Rendered by one of the backends, the interface built above looks like this:

Bindings

There are a number of nuklear bindings for different languages created by other authors. I cannot attest for their quality since I am not necessarily proficient in any of these languages. Furthermore there are no guarantee that all bindings will always be kept up to date:

  • Java by Guillaume Legris
  • D by Mateusz Muszyński
  • Golang by [email protected]
  • Rust by [email protected]
  • Chicken by [email protected]
  • Nim by [email protected]
  • Lua
    • LÖVE-Nuklear by Kevin Harrison
    • MoonNuklear by Stefano Trettel
  • Python
    • pyNuklear by William Emerison Six (ctypes-based wrapper)
    • pynk by [email protected] (cffi binding)
  • CSharp/.NET by [email protected]
  • V by Nicolas Sauzede

Credits

Developed by Micha Mettke and every direct or indirect contributor to the GitHub.

Embeds stb_texedit, stb_truetype and stb_rectpack by Sean Barrett (public domain) Embeds ProggyClean.ttf font by Tristan Grimmer (MIT license).

Big thank you to Omar Cornut (ocornut@github) for his imgui library and giving me the inspiration for this library, Casey Muratori for handmade hero and his original immediate-mode graphical user interface idea and Sean Barrett for his amazing single-header libraries which restored my faith in libraries and brought me to create some of my own. Finally Apoorva Joshi for his single-header file packer.

License

Nuklear is avaliable under either the MIT License or public domain. See LICENSE for more info.

Issues· 315 open

View all issuesOpen on GitHub
  • #251

    Gallery: post your screenshots, images, showcases, code... here

    Updated Sep 26, 2026
  • #222

    checkbox behaviour is reversed and wrong

    Updated Sep 24, 2026
  • #744

    Checkbox Appearance

    Updated Sep 24, 2026
  • #982

    Suggestions for new docking features

    Updated Aug 12, 2026
  • #979

    SDL3: When Font is NULL, use `SDL_RenderDebugText()`

    Updated Aug 11, 2026
  • #966

    [SDL3+Emscripten] 2 issues: nk_label_wrap bleeds and ui unresponsive?

    Updated Aug 11, 2026
  • #815

    Why c89? Why not c99 or c11?

    5.xUpdated Aug 8, 2026
  • #977

    THE example on the documentation page can't be compiled

    Updated Jul 24, 2026
  • #953

    stb_image inconsistencies

    Updated Jul 22, 2026
  • #850

    Some examples can break due to dependency on headers coming from different files

    Updated Jul 22, 2026

> Tags

Ccc89guiheader-only

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 28, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库