Skip to main content

Crate gpuikit

Crate gpuikit 

Source
Expand description

gpuikit

A comprehensive UI component library for GPUI applications.

§Quick Start

use gpui::Application;
use gpuikit::init;

fn main() {
    Application::with_platform(gpui_platform::current_platform(false))
        .with_assets(gpuikit::assets())
        .run(|cx| {
            init(cx);
            // ... your app code
        });
}

The platform comes from gpui_platform, which your app depends on alongside gpui — gpuikit does not re-export either. false asks for a real windowing platform rather than a headless one.

§Feature Flags

All features are off by default.

  • editor — the editor component, and the syntect-backed syntax highlighting markdown code fences use once an app calls markdown::init_code_highlighting (itself gated on this feature)
  • stitch — closes the syntax a partially streamed markdown document leaves open (**bold, [label](htt) before parsing, so streaming text does not flicker between literal markers and styled text. Pulls in mdstitch, which requires Rust 1.95; markdown::preprocessing_available reports which build you got
  • runtime_shaders — compiles Metal shaders at runtime rather than at build time, so a macOS build needs no Xcode Metal toolchain
  • schema — adds the schemars dependency. Nothing here derives JsonSchema yet, so today this only affects your dependency graph

§Minimum Rust version

This crate declares rust-version = "1.85", which is a statement about its own source — async closures, and edition 2024 — rather than a guarantee about a whole build. Edition 2024 selects cargo’s v3 resolver, which unlike v2 does take that floor into account: when it picks a new version of a dependency it prefers one whose own rust-version fits. That is a preference, not a wall, and it says nothing about the versions Cargo.lock already names — several of those declare more (cosmic-text and smol_str 1.89, oo7 1.92 on Linux), so on a toolchain near 1.85 you will most likely meet one of theirs first. A recent stable is the practical answer.

The stitch feature raises gpuikit’s own floor to 1.95. It is the only one that does.

Re-exports§

pub use icons::Icons as DefaultIcons;

Modules§

a11y
How an element in this crate says what it is: one value, one method, one place to change the answer.
date
A minimal civil date, and the arithmetic a month grid needs.
editor
A standalone editor component for GPUI
element_id
The rule for minting ElementIds, and the two helpers that implement it.
elements
error
fs
In-memory file editing backed by the local filesystem.
icons
Default icon set based on Radix Icons
input
Input components for text editing in GPUI applications.
keymap
Keymap module for managing keyboard shortcuts and their associated actions
layout
markdown
Markdown rendering for gpuikit
resource
Resource management for gpui apps
selection
One selection value type, and the arithmetic of moving a highlight through a list, in one place.
theme
A trait-based theme system for gpuikit
traits
Shared traits: the small vocabulary elements agree on — a control size, a click handler, a disabled flag — rather than a place for a trait per idea.
utils

Macros§

bindings
Macro to simplify creating multiple bindings

Structs§

Assets
Embedded assets for gpuikit (icons, fonts, etc.)

Functions§

assets
Returns the gpuikit asset source, for Application::with_assets.
init
Initialize gpuikit - sets up themes and global state.