Installation
Before you start to build your application with gpui-component, you need to install the library.
#Platform requirements
- macOS 15 or later
- Xcode Command Line Tools, installed with
xcode-select --install
- Windows 10 or later
- Visual Studio 2022 Build Tools or Community with the Desktop development with C++ workload, including MSVC and a Windows SDK
- CMake available on
PATH
The following packages are verified on Ubuntu 24.04:
sudo apt update
sudo apt install -y gcc g++ clang libfontconfig-dev libwayland-dev \
libwebkit2gtk-4.1-dev libxkbcommon-x11-dev libx11-xcb-dev \
libssl-dev libzstd-dev vulkan-validationlayers libvulkan1
#Rust and Cargo
We use Rust programming language to build the gpui-component library. Make sure you have Rust and Cargo installed on your system.
- Rust 1.90 or later
- Cargo (comes with Rust)
To install the gpui-component library, you can use Cargo, the Rust package manager. Add the following line to your Cargo.toml file under the [dependencies] section:
gpui-kit = "0.6"
gpui-kit depends on the matching GPUI crates for you, so your application never lists GPUI itself. use gpui_kit::*; is GPUI, and the layers are reachable by name: gpui_kit::component (the styled components), gpui_kit::base, gpui_kit::assets and gpui_kit::platform.
For experimental iOS support and Swift UIView embedding, see Mobile. Mobile uses gpui-pre-mobile and a different application bootstrap from the desktop setup above.
#Improve development runtime performance
Rust Debug builds leave GPUI, the component library, layout, and text rendering
largely unoptimized. As a result, an application started with cargo run can
render and respond much more slowly than its release build. The profile below
optimizes those framework dependencies while your application code remains in
Debug mode and keeps its normal debugging workflow.
This setting does not make compilation faster. Compiling the optimized
dependencies can take longer, especially on the first build; the benefit is
better runtime performance while developing and running the application.
Package profiles only take effect in the root Cargo.toml of your application
or workspace:
[profile.dev.package]
gpui-pre = { opt-level = 3 }
gpui-component = { opt-level = 3 }
gpui-kit = { opt-level = 3 }
gpui-kit-assets = { opt-level = 3 }
gpui-pre-macros = { opt-level = 3 }
gpui-pre-platform = { opt-level = 3 }
rustybuzz = { opt-level = 3 }
taffy = { opt-level = 3 }
ttf-parser = { opt-level = 3 }