# GPUI
GPUI is the UI framework Zed Industries built to render the Zed code editor. The official tagline: "a fast, hybrid immediate and retained mode, GPU-accelerated UI framework for [[Rust]]". It's [[Open Source]] under the [[Apache 2.0 License]], so you can ship apps built with it under any license you like (Zed itself is GPL).
Why build yet another UI framework? Because the Zed founders came from Atom, an [[Electron]] editor, and they could never hit the frame deadline there. At 120 Hz you get 8.33 ms per frame for state updates, layout AND painting. Garbage collection pauses and DOM relayouts kept eating that budget. Meanwhile, games were drawing photorealistic 3D scenes at 120 FPS. So they rendered Zed like a videogame: a custom shader for each primitive (rectangles, shadows, text, icons, images), described as data on the CPU and drawn in parallel on the GPU. Rounded corners and borders come from signed distance functions; instanced rendering puts many rectangles in a single draw call.
The thing is, GPUI was a Zed internal for years. The project started in 2019, a full rewrite ("GPUI 2") shipped in Zed's preview channel in January 2024, and the code went public with Zed on January 24, 2024. Back then it only ran on macOS, which was the main complaint in the HN threads about both announcements. Linux and Windows came later (see below).
## How it works
GPUI gives you three levels (the README calls them "registers"):
- **Entities** hold application state. The `App` owns every entity; you get an `Entity<T>` handle that is reference-counted like an `Rc`, but only lets you read or update the state when you pass it a context. That's how GPUI sidesteps Rust's single-owner rule without exotic data structures. Entities talk through `notify`/`observe` and typed `emit`/`subscribe` events; listeners don't run on the spot, which avoids the reentrancy bugs the team hit in Atom
- **Views** are entities that implement the `Render` trait. Each frame, GPUI calls `render` on the window's root view, which returns a tree of elements styled with a Tailwind-like API (`div().flex().gap_2().bg(...)`). That's the declarative, immediate-mode side
- **Elements** are the low-level, imperative layer. You control layout and painting yourself, which is what Zed uses for huge lists and the editor's custom layout
Everything goes through context parameters (`cx`): `App`, `Context<T>`, async contexts you can hold across `await` points, and `TestAppContext` for tests. Actions map keystrokes to logical operations, an async executor runs inside the platform event loop, and `#[gpui::test]` simulates input. Layout uses the Taffy crate. Accessibility goes through AccessKit; the docs now include a guide and an `a11y` example (screen-reader support was a common complaint about Zed in 2025, so check the current state if you need it, see [[Accessibility (a11y)]]).
Each frame boils down to a scene of quads, shadows, paths, underlines and sprites, handed to a per-platform renderer.
## Platforms
- **macOS**: Metal. Zed's 120 FPS work happened here (triple buffering, and drawing frames for one second after input so ProMotion doesn't downclock the display)
- **Windows**: DirectX 11, with DirectWrite for glyphs. The first Windows port reused the Vulkan renderer, but users without Vulkan couldn't run it, so the team wrote a third set of shaders in HLSL (2025)
- **Linux and FreeBSD**: X11 and Wayland. The renderer started on Blade (Vulkan) in February 2024 and moved to wgpu in February 2026
- **Web**: a `gpui_web` crate (WebAssembly) lives in the Zed repo and is under active development in 2026. Nothing on gpui.rs presents it as supported yet
## Maturity
GPUI is pre-1.0, and the README says so: "There will often be breaking changes between versions", and you need the latest stable Rust. It's developed inside the Zed monorepo, and gpui.rs says it will stay tied to Zed "for the near future", so contributions go through Zed.
Two things to watch:
- **Releases lag the code.** The newest crates.io release is 0.2.2 (October 22, 2025). The README on `main` asks you to add `gpui_platform`, which isn't published on crates.io as of October 2026. If you follow the current README, you'll most likely depend on the Git repo instead
- **Docs are thin.** docs.rs reports 100% of items documented, but the README itself says the best way to learn is reading the Zed source or asking on Zed's Discord. The gpui.rs site is essentially a landing page pointing to the README, the crate root, the examples and two docs (contexts, key dispatch)
## Getting started
Add `gpui` (and optionally `gpui_platform`) to `Cargo.toml`. Create an `Application`, call `run` with a callback, open a window with `open_window`, and register a root view that implements `Render`. The repo ships about 40 examples (hello world, animation, data table, drag and drop, text input, painting, accessibility…).
Platform prerequisites:
- **macOS**: full Xcode plus the command line tools (Metal needs them), and the `font-kit` feature or text won't render
- **Linux/FreeBSD**: enable `wayland`, `x11` or both
- **Windows**: nothing extra
## Who uses it
- **Zed** (91k GitHub stars), and Delta, the agent-coding environment from the same team; gpui.rs says "From the creators of Zed & Delta"
- **Longbridge**, a brokerage, built its Longbridge Pro desktop app on GPUI and open-sourced GPUI Kit (formerly `gpui-component`): 75+ components, data tables, a code editor, docking, WebAssembly support. They also contributed a path-rendering fix to GPUI during Zed's Windows port
- The awesome-gpui list tracks the rest. Lots of developer tools (database clients, terminals, Git clients, apps that drive coding agents), plus helix-gpui and launchers like Loungy (now archived)
## Alternatives
- [[Tauri]]: Rust back end with a webview front end, so you keep HTML/CSS/JS. On the HN launch thread, one commenter asked "why would I ever use this vs something like Tauri?"
- [[Electron]]: the thing GPUI was built to escape
- [[zero-native]]: Zig shell around a web UI
- **egui**: immediate-mode GUI for web and native (MIT or Apache 2.0)
- **Iced**: cross-platform, inspired by Elm (MIT)
- **Slint**: toolkit for embedded devices and desktop apps (GPL 3, royalty-free or commercial license)
- **Dioxus**: one codebase for web, desktop and mobile (MIT or Apache 2.0)
My take: pick GPUI when your app is mostly Rust state and you care about every millisecond of latency. One HN commenter liked that GPUI let him skip Tauri's commands and listeners and implement rendering directly on his existing structs. If you want a web front end, a stable API or mobile targets today, look elsewhere.
## References
- Official website: https://www.gpui.rs
- Examples: https://www.gpui.rs/examples
- Source: https://github.com/zed-industries/zed/tree/main/crates/gpui
- README: https://github.com/zed-industries/zed/blob/main/crates/gpui/README.md
- Contexts doc: https://github.com/zed-industries/zed/blob/main/crates/gpui/docs/contexts.md
- Accessibility guide: https://github.com/zed-industries/zed/blob/main/crates/gpui/src/_accessibility.rs
- Crate manifest (version, license, dependencies): https://github.com/zed-industries/zed/blob/main/crates/gpui/Cargo.toml
- crates.io: https://crates.io/crates/gpui
- docs.rs: https://docs.rs/gpui/latest/gpui/
- Zed blog, "Leveraging Rust and the GPU to render user interfaces at 120 FPS" (Antonio Scandurra, 2023-03-07): https://zed.dev/blog/videogame
- Zed blog, "GPUI 2 is now in production" (2024-01-03): https://zed.dev/blog/gpui-2-on-preview
- Zed blog, "Zed is now open source" (2024-01-24): https://zed.dev/blog/zed-is-now-open-source
- Zed blog, "Ownership and data flow in GPUI" (2024-01-25, updated 2025-12-12): https://zed.dev/blog/gpui-ownership
- Zed blog, "Optimizing the Metal pipeline to maintain 120 FPS in GPUI" (2024-02-07): https://zed.dev/blog/120fps
- Zed blog, "Linux when?" (2024-05-07): https://zed.dev/blog/zed-decoded-linux-when
- Zed blog, "Zed for Windows: What's Taking So Long?!" (2025-08-19): https://zed.dev/blog/windows-progress-report
- PR #7343, Linux port via Blade: https://github.com/zed-industries/zed/pull/7343
- PR #46758, Linux renderer moved to wgpu: https://github.com/zed-industries/zed/pull/46758
- Delta: https://delta.dev
- GPUI Kit (Longbridge): https://github.com/longbridge/gpui-kit
- awesome-gpui: https://github.com/zed-industries/awesome-gpui
- HN, "GPUI - UI framework for Rust from the creators of Zed" (2024-01-24): https://news.ycombinator.com/item?id=39119953
- HN, "GPUI 2 is now in production" (2024-01-04): https://news.ycombinator.com/item?id=38871732
- HN, "Rust cross-platform GPUI components" (2025-10-27): https://news.ycombinator.com/item?id=45719004
- HN, "Show HN: I built a native app for coding agents with Rust and GPUI" (2026-08-16): https://news.ycombinator.com/item?id=49315709
- egui: https://github.com/emilk/egui
- Iced: https://iced.rs
- Slint: https://slint.rs
- Dioxus: https://dioxuslabs.com
## Related
- [[Rust]]
- [[Graphical User Interface (GUI)]]
- [[Tauri]]
- [[Electron]]
- [[zero-native]]
- [[Accessibility (a11y)]]