| Crates.io | dear-imgui-rs |
| lib.rs | dear-imgui-rs |
| version | 0.8.0 |
| created_at | 2025-09-30 03:55:52.28383+00 |
| updated_at | 2026-01-02 17:59:48.755634+00 |
| description | High-level Rust bindings to Dear ImGui v1.92.5 with docking, WGPU/GL backends, and extensions (ImPlot/ImPlot3D, ImNodes, ImGuizmo, file browser, reflection-based UI) |
| homepage | https://github.com/Latias94/dear-imgui-rs |
| repository | https://github.com/Latias94/dear-imgui-rs |
| max_upload_size | |
| id | 1860548 |
| size | 958,365 |
dear-imgui-rs is a Rust bindings ecosystem for Dear ImGui, featuring docking support, WGPU/GL backends, and a rich set of extensions (ImPlot/ImPlot3D, ImGuizmo/ImGuIZMO.quat, ImNodes, file browser, reflection-based UI).
dear-imgui-sys — low‑level FFI via cimgui (docking branch), bindgen against Dear ImGui v1.92.5dear-imgui-rs — safe, idiomatic Rust API (RAII + builder style similar to imgui-rs)dear-imgui-wgpu, dear-imgui-glow, dear-imgui-winit, dear-imgui-sdl3dear-app — convenient Winit + WGPU application runner (docking, themes, add-ons)dear-imguizmo — 3D gizmo (cimguizmo C API) + a pure‑Rust GraphEditordear-imnodes — node editor (cimnodes C API)dear-implot — plotting (cimplot C API)dear-implot3d — 3D plotting (cimplot3d C API)dear-imguizmo-quat — quaternion + 3D gizmo (cimguizmo_quat C API)dear-file-browser — native dialogs (rfd) + pure ImGui in-UI file browserdear-imgui-reflect — reflection-based UI helpers (auto-generate ImGui widgets from Rust types)All crates are maintained together in this workspace.
use dear_imgui_rs::*;
let mut ctx = Context::create();
let ui = ctx.frame();
ui.window("Hello")
.size([300.0, 120.0], Condition::FirstUseEver)
.build(|| {
ui.text("Hello, world!");
if ui.button("Click me") { println!("clicked"); }
});
// Rendering is done by a backend (e.g. dear-imgui-wgpu or dear-imgui-glow)
// Tip: pass `.opened(&mut open)` if you want a title-bar close button (X).
// Tip: For fallible creation, use `Context::try_create()`
# Clone with submodules
git clone https://github.com/Latias94/dear-imgui-rs
git submodule update --init --recursive
# Core & docking examples
cargo run --bin game_engine_docking
cargo run --bin dockspace_minimal
# dear-app examples (application runner with docking support)
cargo run --bin dear_app_quickstart
cargo run --bin dear_app_docking
# Extension examples (using wgpu + winit directly)
cargo run --bin imguizmo_basic --features imguizmo
cargo run --bin imnodes_basic --features imnodes
cargo run --bin implot_basic --features implot
cargo run --bin imguizmo_quat_basic --features imguizmo-quat
cargo run --bin reflect_demo --features reflect
# implot3d example (uses dear-app)
cargo run --bin implot3d_basic --features implot3d
# WebAssembly (WASM) web demo (import-style, ImGui + optional ImPlot/ImPlot3D/ImNodes/ImGuizmo/ImGuIZMO.quat)
# Note: this import-style WASM path is developed on `main` and shipped in the 0.7.x+ release trains.
# For the full setup (bindings generation, web demo build, provider build, and troubleshooting),
# see the "WebAssembly (WASM) support" section below and docs/WASM.md.
# SDL3 backends (native)
# SDL3 + OpenGL3 with official C++ backends (multi-viewport via imgui_impl_sdl3/imgui_impl_opengl3)
cargo run -p dear-imgui-examples --bin sdl3_opengl_multi_viewport --features multi-viewport,sdl3-opengl3
# SDL3 + Glow (experimental multi-viewport using Rust Glow renderer)
cargo run -p dear-imgui-examples --bin sdl3_glow_multi_viewport --features multi-viewport,sdl3-platform
# SDL3 + WGPU (single-window)
cargo run -p dear-imgui-examples --bin sdl3_wgpu --features sdl3-platform
# SDL3 + WGPU (experimental multi-viewport, native only)
cargo run -p dear-imgui-examples --bin sdl3_wgpu_multi_viewport --features sdl3-wgpu-multi-viewport
# winit + WGPU (experimental multi-viewport testbed, native only)
# Enabled on Windows/macOS/Linux; tested on Windows/macOS, Linux untested.
cargo run -p dear-imgui-examples --bin multi_viewport_wgpu --features multi-viewport
Tip: The ImNodes example includes multiple tabs (Hello, Multi-Editor, Style, Advanced Style, Save/Load, Color Editor, Shader Graph, MiniMap Callback).
See examples/README.md for a curated index and the planned from‑easy‑to‑advanced layout.
# OS-native dialogs (rfd)
cargo run --bin file_dialog_native --features file-browser
# Pure ImGui in-UI file browser
cargo run --bin file_browser_imgui --features file-browser
[dependencies]
dear-imgui-rs = "0.8"
# Choose a backend + platform integration
dear-imgui-wgpu = "0.8" # or dear-imgui-glow
dear-imgui-winit = "0.8"
[dependencies]
dear-app = "0.8" # Includes dear-imgui-rs, wgpu backend, and docking support
[dependencies]
# Plotting
dear-implot = "0.8" # 2D plotting
dear-implot3d = "0.8" # 3D plotting
# 3D Gizmos
dear-imguizmo = "0.8" # Standard 3D gizmo + GraphEditor
dear-imguizmo-quat = "0.8" # Quaternion-based gizmo
# Node Editor
dear-imnodes = "0.8"
# File Browser
dear-file-browser = "0.8" # Native dialogs + ImGui file browser
# Reflection-based UI helpers
dear-imgui-reflect = "0.8"
dear-imgui-reflect lets you derive ImGuiReflect on your structs/enums and automatically get Dear ImGui editors for them. It is inspired by the C++ ImReflect library but implemented in pure Rust on top of dear-imgui-rs.
Typical flow:
use dear_imgui_reflect as reflect;
use reflect::ImGuiReflect;
use reflect::ImGuiReflectExt;
#[derive(ImGuiReflect, Default)]
struct Settings {
#[imgui(slider, min = 0, max = 100)]
volume: i32,
fullscreen: bool,
}
fn ui_frame(ui: &reflect::imgui::Ui, settings: &mut Settings) {
ui.input_reflect("Settings", settings);
}
freetype). Linux/macOS may have CI artifacts but are not used automatically.prebuilt or set <CRATE>_SYS_USE_PREBUILT=1. Otherwise builds only use prebuilt when you explicitly point to them (e.g., <CRATE>_SYS_LIB_DIR or <CRATE>_SYS_PREBUILT_URL).Env vars per -sys crate:
<CRATE>_SYS_LIB_DIR — link from a dir containing the static lib<CRATE>_SYS_PREBUILT_URL — explicit URL to .a/.lib or .tar.gz (always honored)<CRATE>_SYS_USE_PREBUILT=1 — allow auto download from GitHub Releases<CRATE>_SYS_PACKAGE_DIR — local dir with .tar.gz packages<CRATE>_SYS_CACHE_DIR — cache root for downloads/extraction<CRATE>_SYS_SKIP_CC — skip C/C++ compilation<CRATE>_SYS_FORCE_BUILD — force source buildIMGUI_SYS_USE_CMAKE / IMPLOT_SYS_USE_CMAKE — prefer CMake when available; otherwise ccCARGO_NET_OFFLINE=true — forbid network; use only local packages or repo prebuiltFreetype: enable once anywhere. Turning on freetype in any extension (imnodes/imguizmo/implot) propagates to dear-imgui-sys. When using a prebuilt dear-imgui-sys with freetype, ensure the package manifest includes features=freetype (our packager writes this).
Quick examples (enable auto prebuilt download):
cargo build -p dear-imgui-sys --features prebuiltIMGUI_SYS_USE_PREBUILT=1 cargo build -p dear-imgui-sys$env:IMGUI_SYS_USE_PREBUILT='1'; cargo build -p dear-imgui-sysThe workspace follows a release-train model. The table below lists the latest, recommended combinations. See docs/COMPATIBILITY.md for full history and upgrade notes.
Core
| Crate | Version | Notes |
|---|---|---|
| dear-imgui-rs | 0.8.x | Safe Rust API over dear-imgui-sys |
| dear-imgui-sys | 0.8.x | Binds Dear ImGui v1.92.5 (docking branch) |
Backends
| Crate | Version | External deps | Notes |
|---|---|---|---|
| dear-imgui-wgpu | 0.8.x | wgpu = 28 | WebGPU renderer (experimental multi-viewport on native via winit/SDL3; disabled on wasm) |
| dear-imgui-glow | 0.8.x | glow = 0.16 | OpenGL renderer (winit/glutin) |
| dear-imgui-winit | 0.8.x | winit = 0.30.12 | Winit platform backend |
| dear-imgui-sdl3 | 0.8.x | sdl3 = 0.17 | SDL3 platform backend (C++ imgui_impl_sdl3/GL3) |
Application Runner
| Crate | Version | Requires dear-imgui-rs | Notes |
|---|---|---|---|
| dear-app | 0.8.x | 0.8.x | App runner (docking, themes, add-ons) |
Extensions
| Crate | Version | Requires dear-imgui-rs | Sys crate | Notes |
|---|---|---|---|---|
| dear-implot | 0.8.x | 0.8.x | dear-implot-sys 0.8.x | 2D plotting |
| dear-imnodes | 0.8.x | 0.8.x | dear-imnodes-sys 0.8.x | Node editor |
| dear-imguizmo | 0.8.x | 0.8.x | dear-imguizmo-sys 0.8.x | 3D gizmo + GraphEditor |
| dear-file-browser | 0.8.x | 0.8.x | — | ImGui UI + native (rfd) backends |
| dear-implot3d | 0.8.x | 0.8.x | dear-implot3d-sys 0.8.x | 3D plotting |
| dear-imguizmo-quat | 0.8.x | 0.8.x | dear-imguizmo-quat-sys 0.8.x | Quaternion gizmo |
| dear-imgui-reflect | 0.8.x | 0.8.x | — | Reflection-based UI helpers (pure Rust) |
Note: if you need wgpu = 27 (or an older toolchain), use the 0.7.x train. The latest core patch is
dear-imgui-rs 0.7.1 (core-only); the rest of the workspace crates remain at 0.7.0.
Maintenance rules
.github/workflows/prebuilt-binaries.yml
tag (release) or branch (manual; default main)crates: comma-separated list (all, dear-imgui-sys, dear-implot-sys, dear-imnodes-sys, dear-imguizmo-sys).tar.gz packages named:
dear-<name>-prebuilt-<version>-<target>-static[-mt|-md].tar.gztools/build-support/src/lib.rs.
Override via env: BUILD_SUPPORT_GH_OWNER, BUILD_SUPPORT_GH_REPO.dear-imgui-rs/ # Safe Rust bindings (renamed from dear-imgui)
dear-imgui-sys/ # cimgui FFI (docking; ImGui v1.92.5)
backends/
dear-imgui-wgpu/ # WGPU renderer
dear-imgui-glow/ # OpenGL renderer
dear-imgui-winit/ # Winit platform
dear-app/ # Application runner (Winit + WGPU + docking + themes)
extensions/
dear-imguizmo/ # ImGuizmo + pure‑Rust GraphEditor
dear-imnodes/ # ImNodes (node editor)
dear-implot/ # ImPlot (2D plotting)
dear-implot3d/ # ImPlot3D (3D plotting)
dear-imguizmo-quat/ # ImGuIZMO.quat (quaternion gizmo)
dear-file-browser/ # File dialogs (rfd) + pure ImGui browser
dear-imgui-reflect/ # Reflection-based UI helpers for dear-imgui-rs
This workspace includes an import-style WASM build that reuses a separate cimgui
provider module (imgui-sys-v0) and shares a single WebAssembly.Memory between
the Rust app (wasm-bindgen) and the provider.
Status:
dear-imgui-web-demo) is wired up and runs on wasm32-unknown-unknown.xtask wasm-bindgen-* / web-demo / build-cimgui-provider
helpers are developed on main and shipped in the 0.7.x release train; for 0.6.x on crates.io,
use a git dependency on this repository if you need these flows.Prerequisites:
rustup target add wasm32-unknown-unknowncargo install -f wasm-bindgen-cli --version 0.2.105xtask web-demo to patch memory imports/exports):
cargo install -f wasm-toolsemsdk) for building the cimgui provider:
emsdk_env.*) or set EMSDK so that
emcc/em++ are on PATH.Quick start (web demo):
# 1) Generate wasm bindings for dear-imgui-sys (optional; xtask will also
# generate them on-demand if missing, using import module name imgui-sys-v0)
cargo run -p xtask -- wasm-bindgen imgui-sys-v0
# 2) Build the main wasm module + JS glue (optionally enable experimental fonts)
cargo run -p xtask -- web-demo --features experimental-fonts
# 3) Build the cimgui provider (emscripten) and import map
cargo run -p xtask -- build-cimgui-provider
# 4) Serve and open in the browser
python -m http.server -d target/web-demo 8080
# Then open http://127.0.0.1:8080
Notes:
target/web-demo/imgui-sys-v0.wasm and imgui-sys-v0.jsimgui-sys-v0-wrapper.js (ESM wrapper) and an import map entry mapping
"imgui-sys-v0" to "./imgui-sys-v0-wrapper.js".xtask web-demo:
env.memory and export it.globalThis.__imgui_shared_memory to env.memory.dear-imgui-rs/wasm-font-atlas-experimentalexamples-wasm/experimental-fonts turns this on for the web demo only.For more details and troubleshooting, see docs/WASM.md.
imgui_impl_sdl3 + imgui_impl_opengl3).
cargo run -p dear-imgui-examples --bin sdl3_opengl_multi_viewport --features multi-viewport,sdl3-opengl3dear-imgui-wgpu/multi-viewport-winit).
dear-imgui-rs/multi-viewportdear-imgui-winit/multi-viewportdear-imgui-wgpu/multi-viewport-winit
and call Context::enable_multi_viewport().cargo run -p dear-imgui-examples --bin multi_viewport_wgpu --features multi-viewportcargo run -p dear-imgui-examples --bin game_engine_docking --features multi-viewportcargo run -p dear-imgui-examples --bin sdl3_wgpu_multi_viewport --features sdl3-wgpu-multi-viewportcargo run -p dear-imgui-examples --bin sdl3_wgpu --features sdl3-platformIf you're working with graphics applications in Rust, you might also be interested in:
This project builds upon the excellent work of several other projects:
Dual-licensed under either of: