{"id":13528327,"url":"https://github.com/flyover/imgui-js","last_synced_at":"2026-01-22T19:37:41.193Z","repository":{"id":44710435,"uuid":"120947980","full_name":"flyover/imgui-js","owner":"flyover","description":"JavaScript bindings for Dear ImGui using Emscripten and TypeScript","archived":false,"fork":false,"pushed_at":"2023-07-22T06:11:55.000Z","size":28684,"stargazers_count":992,"open_issues_count":39,"forks_count":105,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-04-01T11:38:56.677Z","etag":null,"topics":["emscripten","imgui","javascript","typescript"],"latest_commit_sha":null,"homepage":"https://flyover.github.io/imgui-js/example/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flyover.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-02-09T19:42:03.000Z","updated_at":"2025-03-28T12:09:01.000Z","dependencies_parsed_at":"2024-01-13T22:23:17.814Z","dependency_job_id":"2f993c76-3057-4aaf-8ab4-b521c7a08837","html_url":"https://github.com/flyover/imgui-js","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/flyover/imgui-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flyover%2Fimgui-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flyover%2Fimgui-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flyover%2Fimgui-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flyover%2Fimgui-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flyover","download_url":"https://codeload.github.com/flyover/imgui-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flyover%2Fimgui-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28669386,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T19:36:09.361Z","status":"ssl_error","status_checked_at":"2026-01-22T19:36:05.567Z","response_time":144,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["emscripten","imgui","javascript","typescript"],"created_at":"2024-08-01T06:02:25.764Z","updated_at":"2026-01-22T19:37:41.174Z","avatar_url":"https://github.com/flyover.png","language":"TypeScript","readme":"# [imgui-js](https://github.com/flyover/imgui-js)\nJavaScript bindings for [Dear ImGui](https://github.com/ocornut/imgui) using [Emscripten](https://github.com/kripken/emscripten) and [TypeScript](https://github.com/Microsoft/TypeScript)\n\n## Example\n[ImGui JavaScript+WebGL example](https://flyover.github.io/imgui-js/example/)\n\nThe original Dear ImGui demo code from [imgui_demo.cpp](https://github.com/ocornut/imgui/blob/master/imgui_demo.cpp) has been ported to [imgui_demo.ts](example/src/imgui_demo.ts).  Also, the Memory Editor from the [imgui_club](https://github.com/ocornut/imgui_club) project ([imgui_memory_editor.h](https://github.com/ocornut/imgui_club/blob/master/imgui_memory_editor/imgui_memory_editor.h)) has been ported to [imgui_memory_editor.ts](example/src/imgui_memory_editor.ts) and added to the demo for browsing the Emscripten memory space.\n\n[ImGui JavaScript Sandbox](https://codepen.io/flyovergames/pen/xYPBaj)\n\nA [CodePen](https://codepen.io) using the [Ace](https://ace.c9.io) editor to live-edit a window.\n\n[ImGui JavaScript+Three.js example](https://codepen.io/flyovergames/pen/ejXjXj)\n\nA [CodePen](https://codepen.io) using Dear ImGui with [Three.js](https://threejs.org).\n\n## Support\nIf you find this useful, please consider donating to this and the [Dear ImGui](https://github.com/ocornut/imgui) project.  I can also invoice for private support, custom development, etc.\n\n[![PayPal donate button](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=H9KUEZTZHHTXQ\u0026lc=US\u0026item_name=imgui-js\u0026currency_code=USD\u0026bn=PP-DonationsBF:btn_donate_SM.gif:NonHosted \"Donate to this project using Paypal\")\n\n## Notes\nAll functions in the C++ ImGui namespace are exported at the top level of the module.\n```typescript\nimport * as ImGui from \"imgui-js\";\n```\nIndividual exports can be imported as well.\n```typescript\nimport { ImVec2 } from \"imgui-js\";\n```\n\nIn general, functions that take an address of a variable in C++ have been changed to take an access function in JavaScript.  Calling the access function with no arguments returns the variable, calling with a value sets the variable.\n\n```typescript\ntype ImAccess\u003cT\u003e = (value?: T) =\u003e T;\n\nlet show: boolean = true;\n\nconst _show: ImAccess\u003cboolean\u003e = (_: boolean = show): boolean =\u003e show = _;\n\n// get the value of show\nconsole.log(_show()); // true\n\n// set the value of show to false (also returns the updated value)\nconsole.log(_show(false)); // false\n```\n\nIn the following example, the address of `show` in the C++ code has been replaced with an inline arrow access function.\n\n```c++\n#include \"imgui.h\"\nbool show = true;\nvoid draw() {\n    if (ImGui::Button(\"Toggle\")) { show = !show; }\n    if (show) {\n        ImGui::Begin(\"My Window\", \u0026show, ImGuiWindowFlags_AlwaysAutoResize));\n        ImGui::Text(\"Hello, World!\");\n        ImGui::End();\n    }\n}\n```\n\n```typescript\nimport * as ImGui from \"imgui-js\";\nlet show: boolean = true;\nfunction draw(): void {\n    if (ImGui.Button(\"Toggle\")) { show = !show; }\n    if (show) {\n        ImGui.Begin(\"My Window\", (_ = show) =\u003e show = _, ImGui.WindowFlags.AlwaysAutoResize));\n        ImGui.Text(\"Hello, World!\");\n        ImGui.End();\n    }\n}\n```\n\nEnumerations that begin with ImGui* are also exported with ImGui removed.  So the following examples are equivalent.\n```typescript\nimport * as ImGui from \"imgui-js\";\nconst flags: ImGui.WindowFlags = ImGui.WindowFlags.AlwaysAutoResize;\n```\n```typescript\nimport { ImGuiWindowFlags } from \"imgui-js\";\nconst flags: ImGuiWindowFlags = ImGuiWindowFlags.AlwaysAutoResize;\n```\n\nIn order to minimize size of the output, the C++ library has been compiled with `IMGUI_DISABLE_OBSOLETE_FUNCTIONS` and `IMGUI_DISABLE_DEMO_WINDOWS`.\n\n## Building\n* `git clone git@github.com:flyover/imgui-js.git`\n* `cd imgui-js`\n* `git submodule update --init --recursive`\n* download and install [Emscripten](http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html)\n* `npm install`\n* `make`\n* `make start-example-html`\n\n## TODO\n* file I/O, imgui.ini, loading external fonts\n* implement ImGuiTextFilter (add support for JavaScript RegExp's)\n* implement ImGuiTextBuffer (simplify to array of strings)\n* fill in remainder of any missing API\n* automate the Emscripten install and environment setup in npm install\n\n## License\nimgui-js is licensed under the MIT License, see [LICENSE](LICENSE.txt) for more information.\n","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=H9KUEZTZHHTXQ\u0026lc=US\u0026item_name=imgui-js\u0026currency_code=USD\u0026bn=PP-DonationsBF:btn_donate_SM.gif:NonHosted"],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflyover%2Fimgui-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflyover%2Fimgui-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflyover%2Fimgui-js/lists"}