Dear ImGui Bundle: Build Real-Time Python web applications with Zero Fuss #362
Closed
pthom
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
1. Introduction:
The web development environment is a jungle for the Python developer
Tools like Streamlit, Gradio, and Jupyter have gone a long way in simplifying the bridge between Python and the browser. They abstract away much of the boilerplate when building a Web Gui with Python. However, when things break, you're suddenly wrestling with JavaScript errors, layout issues in CSS, or debugging the front-end / back-end synchronization.
And you might think

But what if you could skip all that and just write Python? What if your GUI code could be:
Welcome to the Immediate Mode GUI paradigm — and the world of Dear ImGui and ImGui Bundle.
In this article:
Demonstration time!
Minimal demonstration
Below is a minimal example that draws a heart shape and allows you to adjust the heart pulse rate using a slider. Its code is almost entirely in Python (with a bit of HTML and JavaScript just to launch Python).
Code for this minimal demo
This runs:
* in your browser
* in pure Python (via Pyodide)
* with real ImGui + ImPlot rendering (no HTML/CSS involved)
Online playground
An online playground will enable you to run and edit ImGui applications in the browser without any setup.
2. The Immediate Mode GUI Paradigm
Immediate Mode GUIs (IMGUI) differ from traditional retained-mode frameworks. Instead of building and maintaining an abstract UI tree, you declare your widgets anew each frame — just like calling
print()
repeatedly in a loop.This approach leads to:
For instance, displaying button and handling its action in ImGui might just look like:
Frameworks like Streamlit, Gradio, and Dash rely on a layered architecture that separates logic from rendering. When things go wrong, you often find yourself debugging JavaScript, CSS, or frontend/backend sync issues.
In contrast, Immediate Mode GUIs are radically simple.
There’s no event queue to wire, no hidden reactive state — just Python code running in a loop, directly rendering the GUI. Whether you run it natively or in the browser via Pyodide, your UI logic stays local, explicit, and easy to debug.
Comparison: Immediate Mode vs classic Python Web GUIs
3. Enter Dear ImGui
Dear ImGui is a fast, lightweight C++ library designed for building rich graphical user interfaces in real-time applications. Originally developed for debugging tools in game engines, it's now used across industries for visualization, simulation, embedded UIs, and more.
ImGui follows the Immediate Mode GUI paradigm: widgets are declared directly in your rendering loop, which makes it incredibly responsive, debuggable, and easy to integrate.
It’s known for:
With 66k+ GitHub stars and a passionate community, ImGui has become a go-to for developers who want full control and minimal friction when building UIs.
4. Meet Dear ImGui Bundle
Dear ImGui Bundle builds on top of Dear ImGui to offer a ready-to-use, cross-platform toolkit for both C++ and Python. It wraps the core ImGui API with batteries included: advanced widgets, plotting (ImPlot), image handling, markdown rendering, node editors, and more.
With full Python bindings and API consistency with C++, it’s a great match for data scientists, educators, and toolmakers who want to go fast — without giving up control.
5. ImGui Bundle in the Browser (via Pyodide)
ImGui Bundle isn't just another GUI library — it offers something rare:
For anyone building internal tools, teaching environments, or portable visual apps, this approach offers unmatched simplicity and power.
This makes ImGui Bundle a rare breed: a Python GUI framework that works identically across desktop and browser — with the same codebase. Porting python GUI to C++ is easy too, since the Python and C++ API are very close.
Demo: Interactive playground: Try it in your browser
6. Test it
You can download the Pyodide distribution with ImGui Bundle pre-installed from the following link: Download Pyodide with ImGui Bundle
ImGui Bundle is in the process of being added to the official Pyodide recipes, so you will be able to use it without downloading anything in the future. See relevant PR
Beta Was this translation helpful? Give feedback.
All reactions