simple-gpui 0.3.0

A simple declarative API for gpui.
Documentation

Simple GPUI

中文文档

Quick Start

Add this to your Cargo.toml:

[dependencies]
simple-gpui = "0.1.0"
gpui = "0.2.2"
gpui-component = "0.3.1"

Then run an example:

cargo run --example hello_world

Minimal example:

use gpui::*;
use simple_gpui_core::component;

#[component]
fn hello_world(_window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
    component_property!(text: SharedString = SharedString::new("World"));
    
    div()
        .flex()
        .flex_col()
        .items_center()
        .justify_center()
        .child(format!("Hello, {}!", &self.text))
}

fn main() {
    Application::new().run(|cx: &mut App| {
        cx.open_window(WindowOptions::default(), |_, cx| {
            cx.new(|cx| HelloWorld::new(cx))
        }).unwrap();
    });
}

For full documentation, guides, and API details, please visit:

https://github.com/zrll12/simple-gpui/wiki