Readme update #40
This commit is contained in:
@@ -17,21 +17,23 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<b>OSUI is a customizable terminal user interface (TUI) library written in Rust. It provides a set of components and rsx to build interactive command-line interfaces with ease.</b>
|
<b>OSUI is a customizable terminal user interface (TUI) library written in Rust.</b>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
use osui::prelude::*;
|
use osui::prelude::*;
|
||||||
|
|
||||||
fn main() -> std::io::Result<()> {
|
pub fn main() {
|
||||||
let screen = Screen::new();
|
let engine = Console::new();
|
||||||
|
engine.run(App {}).expect("Failed to run engine");
|
||||||
rsx! {
|
|
||||||
"Hello, World"
|
|
||||||
}
|
}
|
||||||
.draw(&screen);
|
|
||||||
|
|
||||||
screen.run()
|
#[component]
|
||||||
|
fn App(cx: &Arc<Context>) -> View {
|
||||||
|
rsx! {
|
||||||
|
"Hello World"
|
||||||
|
}
|
||||||
|
.view(&cx)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user