Create

Sign in to ReadmeX

or

How we handle your data: Privacy Policy

ReadmeX

Your AI reading companion

What would you like to catch up on?

Pick a briefing, or ask your own question.

Your community and people briefings stay personal to you.

gpui-kit

gpui-kit: A Rust desktop application framework combining a styled UI system with reusable behavior, state, and infrastructure.

What problem it solves

Desktop applications need reusable interaction behavior, state management, infrastructure, and a coherent visual system. GPUI Kit organizes these capabilities into layers that can be adopted together or used independently, while also supporting accessibility, integration testing, WebAssembly, and scripted extensions.

Key features

  • Layered framework architecture — Applications can use the complete styled component catalog, build a custom design system on the unstyled foundation, or add a JavaScript extension runtime.

    Source: README

  • Broad component catalog — The styled UI layer includes forms, navigation, overlays, data display, editing, feedback, and layout components with productive defaults.

    Source: README, crates/component

  • Accessibility and integration testing — AccessKit metadata is integrated into the interaction layer, while UI integration tests render components in headless windows and exercise interaction and layout behavior.

    Source: README

  • Cross-platform and WebAssembly support — A Rust codebase can target desktop platforms, and applications and component showcases can run on the Web with the WebAssembly target.

    Source: README

  • Scripted application extensions — The optional shell layer lets a Rust host load panels and business logic as JavaScript scripts, with capabilities granted explicitly.

    Source: README, crates/shell

Quick start

Copied verbatim from the project's README.

[dependencies]
gpui-kit = "0.7"
use gpui_kit::component::button::*;
use gpui_kit::component::*;
use gpui_kit::*;

pub struct HelloWorld;
impl Render for HelloWorld {
    fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {
        div()
            .v_flex()
            .gap_2()
            .size_full()
            .items_center()
            .justify_center()
            .child("Hello, World!")
            .child(
                Button::new("ok")
                    .primary()
                    .label("Let's Go!")
                    .on_click(|_, _, _| println!("Clicked!")),
            )
    }
}

fn main() {
    gpui_kit::application().run(move |cx| {
        // This must be called before using any GPUI Component features.
        gpui_kit::init(cx);

        gpui_kit::open_window(WindowOptions::default(), cx, |_, cx| {
            cx.new(|_| HelloWorld)
        })
        .expect("Failed to open window");
    });
}

Who it may suit

This may suit Rust developers building cross-platform desktop applications who want reusable styled components or a foundation for their own design system. It may also suit teams that need accessibility, headless UI integration tests, WebAssembly targets, or post-release JavaScript extensions.

Topics to discuss

  • Which component or infrastructure capabilities would be most useful in your next GPUI application?

  • How should teams decide between the styled component layer and a custom design system?

  • What capabilities and workflows should the JavaScript extension runtime expose to application teams?


Written by ReadmeX AI from the project's README, source and public GitHub data; it may contain mistakes.

Read the original README https://github.com/longbridge/gpui-kit#readme

ReadmeX opened this community for a trending project; it is not run by the project. Maintainers can claim it from the community page.

github.comhttps://github.com/longbridge/gpui-kit

Comments

…