This commit is contained in:
2025-06-30 12:19:17 -05:00
parent c2a3899fe1
commit 915dabe9e2
17 changed files with 773 additions and 1 deletions
+54
View File
@@ -0,0 +1,54 @@
---
title: Introduction
slug: /
---
## Installation
On a cargo project run
```bash
cargo add osui
```
## Hello world
```rust title='src/main.rs'
use osui::prelude::*;
fn main() -> Result<()> {
let mut con = console::init(true)?;
con.run(app())?;
con.end()
}
pub fn app() -> Element {
rsx! {
"Hello, World!"
}
}
```
## Counter
```rust title='src/main.rs'
use osui::prelude::*;
fn main() -> Result<()> {
let mut con = console::init(true)?;
con.run(app())?;
con.end()
}
pub fn app() -> Element {
let count = use_state(0);
rsx! {
button { on_click: move |_| count+=1, "{count}" }
}
}
```