GPUI Community Edition
GPUI is a Rust UI framework for macOS, Windows, Linux, and the web. A view
builds an element tree for layout, input, and painting; entities hold the
application state that views read. After changing state that a view displays,
call notify so GPUI can render the windows that depend on it.
GPUI was built by Zed Industries for the Zed editor. GPUI Community Edition is a community-maintained fork for standalone applications.
To try GPUI in a new application, add these dependencies to Cargo.toml and put the
program below in src/main.rs:
[]
= { = "gpui-ce", = "0.2" }
= { = "gpui_ce_platform", = "0.1" }
These requirements select published releases. Repository documentation may describe APIs newer than those releases. If this example does not compile with the versions Cargo resolves, pin both dependencies to the same git revision as described in the project guide.
use ;
;
Run it with cargo run. gpui_platform selects the platform backend; the
application callback creates the entity that becomes the window's root view.
Platform backends
GPUI uses Parley for text shaping, wrapping, hit testing, and font fallback on
each platform. gpui_platform selects the windowing and rendering integrations.
The choice affects setup and available services:
- On macOS, windows use the native app backend and Metal rendering.
- On Linux and FreeBSD, enable
wayland,x11, or both for desktop windows. - On Windows, windows use Win32 and rendering uses DirectX.
- The web build uses the browser backend; see the web guide for its font and build requirements.
The big picture
Application state lives in Entity values. A Render implementation turns
an entity into a view, and the view builds an element tree for layout, input, and
painting. Use a custom Element when a view needs control over those phases,
such as for a virtualized list or custom drawing. The concepts
pages explain how entities, views, elements, contexts, and frames connect.
Learn
- Documentation: the API reference, plus a tutorial, guides, and concepts that connect state, rendering, and input.
- Examples: complete programs that also run live on the GPUI-CE website.
- Discord for questions and discussion.
Requirements
Use Rust 1.95 or newer. Desktop builds also need Xcode on macOS, development libraries for the Linux backends, or the MSVC toolchain and Windows SDK on Windows. The project setup guide lists the requirements and installation commands.
License
Apache-2.0.