# Pyzed vs Dear PyGui

> Pyzed vs Dear PyGui for Python desktop GUIs: retained Elm-style UI vs immediate-mode ImGui, look, tooling and measured numbers, with the same apps side by side and when each one fits.

Source: https://albakore.github.io/pyzed/why/vs-dear-pygui/

[Dear PyGui](https://github.com/hoffstadt/DearPyGui) wraps [Dear ImGui](https://github.com/ocornut/imgui),
the immediate-mode toolkit used for debug tools in game engines. It is GPU-drawn and very fast, and it
shines for real-time plots, node editors and internal tools. Its look is the ImGui "tool" look, and it
redraws continuously, which suits a dashboard that changes every frame more than a form that changes when
you click.

## In short

| | Pyzed | Dear PyGui |
| --- | --- | --- |
| Model | State + `view()` (Elm architecture) | Items created once with tags, changed with `set_value` / `configure_item` |
| Redraws | When something changes | Every frame, by default |
| Look | Modern ready-made components, themes, dark mode | ImGui tool style, configurable with themes |
| Text | Full shaping, any script, emoji, rich text and markdown | Fonts and glyph ranges you load yourself |
| Plots | [Sparklines, bar and donut charts](https://albakore.github.io/pyzed/library/bar-chart/), a canvas | Excellent built-in plotting (ImPlot) |
| Desktop features | Menus, shortcuts, multi-window, docks, code editor | Docking and viewports from ImGui |
| Designer, hot reload | Pyzed Design, `pyzed dev` | – |
| Accessibility | Keyboard; no screen readers yet | No screen readers |

## The same counter

## The same to-do list

## Measured

Medians from [the benchmarks](https://albakore.github.io/pyzed/why/benchmarks/) (Linux, no GPU: both render through Mesa's software
drivers).

## From Dear PyGui concepts to Pyzed

| Dear PyGui | Pyzed |
| --- | --- |
| `create_context`, `create_viewport`, `start_dearpygui` | `pz.run(MyApp)` |
| `with dpg.window(...)` | the root returned by `view()` |
| `dpg.add_text(tag="x")` + `dpg.set_value("x", ...)` | `ui.label(self.x)`: change `self.x` |
| `callback=fn` | `on_press=fn` |
| `dpg.group(horizontal=True)` | `pz.row` |
| `dpg.child_window` | `pz.scrollable`, `ui.card`, `ui.panel` |
| `dpg.theme()` + `bind_item_theme` | [themes](https://albakore.github.io/pyzed/theming/themes/) and [styles](https://albakore.github.io/pyzed/theming/styles/) |
| `dpg.add_plot` | [`ui.bar_chart`](https://albakore.github.io/pyzed/library/bar-chart/), [`ui.sparkline`](https://albakore.github.io/pyzed/library/sparkline/), or [`pz.canvas`](https://albakore.github.io/pyzed/guides/canvas/) for custom drawing |

## When to choose which

- **Choose Dear PyGui** for real-time plots, node editors, instrument panels and debug tools where the
  ImGui look is fine.
- **Choose Pyzed** for end-user apps: forms, lists, editors and dashboards that should look polished, with
  proper text, a designer, hot reload and packaging.
