JavaScript bindings for Dear ImGui.
npm install @mori2003/jsimgui



JavaScript/TypeScript bindings for the Dear ImGui library.
- WebGL, WebGL2 and WebGPU supported
- Using docking branch of Dear ImGui
- Simple API which tries to feel familiar to the original
- Original comments preserved from Dear ImGui
- Good IDE support thanks to TypeScript
Clear canvas
- WebGL - View Example
- WebGL2 - View Example
- WebGPU - View Example
Three.js
- Three.js WebGL2 - View Example
PixiJS
- PixiJS - View Example
Babylon.js
- Babylon.js - View Example
Dear ImGui is rendered to a element. Here is a short single-file example (also on CodePen).
For more information, see the wiki.
``html`
`bash`
git clone https://github.com/mori2003/jsimgui.git --recurse-submodules
cd jsimgui
#### Using Docker Image
`bash`
docker build -t jsimgui -f .github/Dockerfile .
docker run -v "$PWD:/workspace" jsimgui bash -c "npm install && node build.ts"
#### Manually
Prerequisites
- A Node.js compatible runtime (Node.js >= v22.18.0, Deno, Bun)
- Emscripten >= v4.0.18
- Python with Ply (For dear_bindings)
`bash`
npm install
This will build the default library configuration: WebGL2, truetype font loader, no demos.
`bash`
node build.ts
You can specify what configuration to build like so:
`bash
node build.ts --backend=webgpu --font-loader=freetype --demos
node build.ts --help # To see all options
`
```
docs/ # Usage examples
src/ # Bindings generator source code
third_party/ # Dependencies (imgui, dear_bindings)