{"id":13418115,"url":"https://github.com/Immediate-Mode-UI/Nuklear","last_synced_at":"2025-03-15T02:32:44.750Z","repository":{"id":37561895,"uuid":"224151065","full_name":"Immediate-Mode-UI/Nuklear","owner":"Immediate-Mode-UI","description":"A single-header ANSI C immediate mode cross-platform GUI library","archived":false,"fork":false,"pushed_at":"2024-10-03T03:08:10.000Z","size":10659,"stargazers_count":9196,"open_issues_count":275,"forks_count":557,"subscribers_count":133,"default_branch":"master","last_synced_at":"2024-10-16T13:04:49.589Z","etag":null,"topics":["c","c89","gui","header-only","imgui","multiplatform","nuklear","single-header","single-header-lib"],"latest_commit_sha":null,"homepage":"https://immediate-mode-ui.github.io/Nuklear/doc/index.html","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Immediate-Mode-UI.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-26T09:21:47.000Z","updated_at":"2024-10-16T12:39:16.000Z","dependencies_parsed_at":"2023-02-10T12:00:40.549Z","dependency_job_id":"80087d40-40e3-4ad1-b3c1-ddab48ef0385","html_url":"https://github.com/Immediate-Mode-UI/Nuklear","commit_stats":{"total_commits":1687,"total_committers":172,"mean_commits":9.80813953488372,"dds":0.3568464730290456,"last_synced_commit":"1d9fb0bc79f8d4377a4dbc732c811b2d696c4c96"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Immediate-Mode-UI%2FNuklear","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Immediate-Mode-UI%2FNuklear/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Immediate-Mode-UI%2FNuklear/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Immediate-Mode-UI%2FNuklear/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Immediate-Mode-UI","download_url":"https://codeload.github.com/Immediate-Mode-UI/Nuklear/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221532202,"owners_count":16838916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","c89","gui","header-only","imgui","multiplatform","nuklear","single-header","single-header-lib"],"created_at":"2024-07-30T22:00:58.614Z","updated_at":"2025-03-15T02:32:44.728Z","avatar_url":"https://github.com/Immediate-Mode-UI.png","language":"C","readme":"# Nuklear\n\n[![](https://github.com/Immediate-Mode-UI/Nuklear/workflows/C%2FC++%20CI/badge.svg )](https://github.com/Immediate-Mode-UI/Nuklear/actions)\n\nThis is a minimal-state, immediate-mode graphical user interface toolkit\nwritten in ANSI C and licensed under public domain. It was designed as a simple\nembeddable user interface for application and does not have any dependencies,\na default render backend or OS window/input handling but instead provides a\nhighly modular, library-based approach, with simple input state for input and\ndraw commands describing primitive shapes as output. So instead of providing a\nlayered library that tries to abstract over a number of platform and\nrender backends, it focuses only on the actual UI.\n\n## Features\n\n- Immediate-mode graphical user interface toolkit\n- Single-header library\n- Written in C89 (ANSI C)\n- Small codebase (~18kLOC)\n- Focus on portability, efficiency and simplicity\n- No dependencies (not even the standard library if not wanted)\n- Fully skinnable and customizable\n- Low memory footprint with total control of memory usage if needed / wanted\n- UTF-8 support\n- No global or hidden state\n- Customizable library modules (you can compile and use only what you need)\n- Optional font baker and vertex buffer output\n- [Documentation](https://Immediate-Mode-UI.github.io/Nuklear/)\n\n## Building\n\nThis library is self-contained in one single header file and can be used either\nin header-only mode or in implementation mode. The header-only mode is used\nby default when included and allows including this header in other headers\nand does not contain the actual implementation.\n\nThe implementation mode requires defining the preprocessor macro\n`NK_IMPLEMENTATION` in *one* .c/.cpp file before `#include`ing this file, e.g.:\n```c\n#define NK_IMPLEMENTATION\n#include \"nuklear.h\"\n```\nIMPORTANT: Every time you include \"nuklear.h\" you have to define the same optional flags.\nThis is very important; not doing it either leads to compiler errors, or even worse, stack corruptions.\n\n## Gallery\n\n![screenshot](https://cloud.githubusercontent.com/assets/8057201/11761525/ae06f0ca-a0c6-11e5-819d-5610b25f6ef4.gif)\n![screen](https://cloud.githubusercontent.com/assets/8057201/13538240/acd96876-e249-11e5-9547-5ac0b19667a0.png)\n![screen2](https://cloud.githubusercontent.com/assets/8057201/13538243/b04acd4c-e249-11e5-8fd2-ad7744a5b446.png)\n![node](https://cloud.githubusercontent.com/assets/8057201/9976995/e81ac04a-5ef7-11e5-872b-acd54fbeee03.gif)\n![skinning](https://cloud.githubusercontent.com/assets/8057201/15991632/76494854-30b8-11e6-9555-a69840d0d50b.png)\n![gamepad](https://cloud.githubusercontent.com/assets/8057201/14902576/339926a8-0d9c-11e6-9fee-a8b73af04473.png)\n\n## Example\n\n```c\n/* init gui state */\nstruct nk_context ctx;\nnk_init_fixed(\u0026ctx, calloc(1, MAX_MEMORY), MAX_MEMORY, \u0026font);\n\nenum {EASY, HARD};\nstatic int op = EASY;\nstatic float value = 0.6f;\nstatic int i =  20;\n\nif (nk_begin(\u0026ctx, \"Show\", nk_rect(50, 50, 220, 220),\n    NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE)) {\n    /* fixed widget pixel width */\n    nk_layout_row_static(\u0026ctx, 30, 80, 1);\n    if (nk_button_label(\u0026ctx, \"button\")) {\n        /* event handling */\n    }\n\n    /* fixed widget window ratio width */\n    nk_layout_row_dynamic(\u0026ctx, 30, 2);\n    if (nk_option_label(\u0026ctx, \"easy\", op == EASY)) op = EASY;\n    if (nk_option_label(\u0026ctx, \"hard\", op == HARD)) op = HARD;\n\n    /* custom widget pixel width */\n    nk_layout_row_begin(\u0026ctx, NK_STATIC, 30, 2);\n    {\n        nk_layout_row_push(\u0026ctx, 50);\n        nk_label(\u0026ctx, \"Volume:\", NK_TEXT_LEFT);\n        nk_layout_row_push(\u0026ctx, 110);\n        nk_slider_float(\u0026ctx, 0, \u0026value, 1.0f, 0.1f);\n    }\n    nk_layout_row_end(\u0026ctx);\n}\nnk_end(\u0026ctx);\n```\n![example](https://cloud.githubusercontent.com/assets/8057201/10187981/584ecd68-675c-11e5-897c-822ef534a876.png)\n\n## Bindings\nThere are a number of nuklear bindings for different languages created by other authors.\nI cannot attest for their quality since I am not necessarily proficient in any of these\nlanguages. Furthermore there are no guarantee that all bindings will always be kept up to date:\n\n- [Java](https://github.com/glegris/nuklear4j) by Guillaume Legris\n- [D](https://github.com/Timu5/bindbc-nuklear) by Mateusz Muszyński\n- [Golang](https://github.com/golang-ui/nuklear) by golang-ui@github.com\n- [Rust](https://github.com/snuk182/nuklear-rust) by snuk182@github.com\n- [Chicken](https://github.com/wasamasa/nuklear) by wasamasa@github.com\n- [Nim](https://github.com/zacharycarter/nuklear-nim) by zacharycarter@github.com\n- Lua\n  - [LÖVE-Nuklear](https://github.com/keharriso/love-nuklear) by Kevin Harrison\n  - [MoonNuklear](https://github.com/stetre/moonnuklear) by Stefano Trettel\n- Python\n  - [pyNuklear](https://github.com/billsix/pyNuklear) by William Emerison Six (ctypes-based wrapper)\n  - [pynk](https://github.com/nathanrw/nuklear-cffi) by nathanrw@github.com (cffi binding)\n- [CSharp/.NET](https://github.com/cartman300/NuklearDotNet) by cartman300@github.com\n- [V](https://github.com/nsauzede/vnk) by Nicolas Sauzede\n\n## Credits\nDeveloped by Micha Mettke and every direct or indirect contributor to the GitHub.\n\n\nEmbeds `stb_texedit`, `stb_truetype` and `stb_rectpack` by Sean Barrett (public domain)\nEmbeds `ProggyClean.ttf` font by Tristan Grimmer (MIT license).\n\n\nBig thank you to Omar Cornut (ocornut@github) for his [imgui](https://github.com/ocornut/imgui) library and\ngiving me the inspiration for this library, Casey Muratori for handmade hero\nand his original immediate-mode graphical user interface idea and Sean\nBarrett for his amazing single-header [libraries](https://github.com/nothings/stb) which restored my faith\nin libraries and brought me to create some of my own. Finally Apoorva Joshi for his single-header [file packer](http://apoorvaj.io/single-header-packer.html).\n\n## License\nNuklear is avaliable under either the MIT License or public domain.\nSee [LICENSE](LICENSE) for more info.\n\n## Reviewers guide\n\nWhen reviewing pull request there are common things a reviewer should keep\nin mind.\n\nReviewing changes to `src/*` and `nuklear.h`:\n\n* Ensure C89 compatibility.\n* The code should work for several backends to an acceptable degree.\n* Check no other parts of `nuklear.h` are related to the PR and thus nothing is missing.\n* Recommend simple optimizations.\n  * Pass small structs by value instead of by pointer.\n  * Use local buffers over heap allocation when possible.\n* Check that the coding style is consistent with code around it.\n  * Variable/function name casing.\n  * Indentation.\n  * Curly bracket (`{}`) placement.\n* Ensure that the contributor has bumped the appropriate version in\n  [clib.json](https://github.com/Immediate-Mode-UI/Nuklear/blob/master/clib.json)\n  and added their changes to the\n  [CHANGELOG](https://github.com/Immediate-Mode-UI/Nuklear/blob/master/src/CHANGELOG).\n* Have at least one other person review the changes before merging.\n\nReviewing changes to `demo/*`, `example/*` and other files in the repo:\n\n* Focus on getting working code merged.\n  * We want to make it easy for people to get started with Nuklear, and any\n    `demo` and `example` improvements helps in this regard.\n* Use of newer C features, or even other languages is not discouraged.\n  * If another language is used, ensure that the build process is easy to figure out.\n* Messy or less efficient code can be merged so long as these outliers are pointed out\n  and easy to find.\n* Version shouldn't be bumped for these changes.\n* Changes that improves code to be more inline with `nuklear.h` are ofc always welcome.\n\n","funding_links":[],"categories":["C","GUI","HarmonyOS","Code","Graphical User Interface","ComputerGraphics \u0026\u0026 Shadingv","Libraries","库 Libraries","图形用户界面","Graphics"],"sub_categories":["Windows Manager","Engines and Frameworks","Google Analytics","GUI","GUI GUI","Zigged Project","C"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FImmediate-Mode-UI%2FNuklear","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FImmediate-Mode-UI%2FNuklear","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FImmediate-Mode-UI%2FNuklear/lists"}