Dear ImGui Bundle: (web) apps in pure Python with a single code base

Thanks to Dear ImGui Bundle, which is now available in Pyodide (a web distribution of Python), it is now possible to develop sophisticated GUI and apps in Python with a code that :

  • can be used to deploy to full desktop applications
  • or run (with the same code) in the browser, without requiring a distant server, and without relying on any HTML / DOM / Javascript
  • provides access to numerous widgets and libraries (widgets, scientific plotting,  image analysis, etc)
  • is highly readable

Minimal demonstration

Here is a minimal web example that draws an animated heart with and adjustable heart beat. You are encouraged to have a look at its code, which is  almost entirely in Python (with a bit of HTML and JavaScript, just to  launch Python).

Online playground

An online playground will enable you to run and edit various ImGui applications in the browser without any setup.

An image processing application, with a sophisticated image viewer

Comparison with traditional web python libraries

Tools like Streamlit and Gradio abstract away much of the boilerplate when building a Web Gui with  Python, and simplify the bridge between Python and the browser.
However, when things break, you're suddenly wrestling with  JavaScript errors, layout issues in CSS, or debugging the client-server synchronization:

This is where using a tool like ImGui Bundle shines : apps developed with Dear ImGui Bundle never use any HTML element (button, etc), each call is synchronous, and everything that you see is drawn via calls to the GPU.


In this article

  • We explain how Immediate Mode GUI works
  • We introduce Dear ImGui, a reputable Immediate Mode GUI library (C++)
  • We explore ImGui Bundle, which brings Dear ImGui to Python, together with lots of utilities
  • And we show how it all works in your browser, with Pyodide

The Immediate Mode GUI Paradigm

What is Immediate Mode GUI?
Immediate Mode GUIs (IMGUI) differ from traditional  retained-mode frameworks. Instead of building and maintaining an  abstract UI tree, you declare your widgets at each frame — just like  calling print() repeatedly in a loop.

This approach leads to:

  • Simple, stateless, and readable code
  • Full control over rendering and logic, frame-by-frame
  • Great debugging and introspection: there's no hidden state behind the GUI

For instance, displaying button and handling its action in ImGui might just look like:

Compared to retained-mode and web-based GUIs

Frameworks like Streamlit and Gradio rely on a layered architecture that separates logic from rendering.

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, the UI logic stays  local, explicit, and easy to debug.

Comparison: Immediate Mode vs classic Python Web GUIs

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.

Dear ImGui is known for:

  • Extremely high performance (everything is drawn via the GPU)
  • A focus on developer productivity and iteration speed
  • A powerful ecosystem: plotting (ImPlot), markdown, node editors, etc.

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.

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 comes with batteries included, as it includes the core of ImGui, together with  advanced  widgets and libraries, for plotting (ImPlot and ImPlot3d), image handling, markdown rendering, node  editors, and more.

It provides documented Python bindings for ImGui and all the included libraries. These bindings are auto-generated, which means, that they will always be up to date with the latest versions.

An ideal framework for prototyping and exploration

Dear ImGui Bundle is a great match for data scientists, educators, and toolmakers who want to tests their ideas and build prototypes quickly, without giving up control.

ImGui Bundle in the Browser (via Pyodide)
Thanks to its availability in Pyodide, ImGui Bundle is now a Python GUI framework that works  identically across desktop and browser, with the same codebase.

Of course, there are some limitations due to the web environment: sandboxing, no filesystem access, etc. The distribution is a bit heavy since pyodide itself is a 9MB download, and imgui-bundle is another 9MB download.

Test it

On your computer

Dear ImGui Bundle is available on pypi.

pip install imgui-bundle  # MIT license

On the web

You can download the Pyodide distribution with ImGui Bundle pre-installed from the following link: Download Pyodide with ImGui Bundle

ImGui Bundle was just added to the official Pyodide recipes, so you will be able to use it without downloading anything in the future. See relevant PR