Simple GPUI
Quick Start
Add this to your Cargo.toml:
[]
= "0.1.0"
= "0.2.2"
= "0.3.1"
Then run an example:
Minimal example:
use *;
use component;
For full documentation, guides, and API details, please visit:
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: