dioxus/packages/dioxus-tui/examples/list.rs

29 lines
573 B
Rust
Raw Normal View History

2022-01-01 04:53:37 +00:00
use dioxus::prelude::*;
fn main() {
dioxus_tui::launch(app);
2022-01-01 04:53:37 +00:00
}
fn app(cx: Scope) -> Element {
cx.render(rsx! {
div {
width: "100%",
height: "100%",
flex_direction: "column",
border_width: "1px",
h1 { height: "2px", color: "green",
"that's awesome!"
}
ul {
flex_direction: "column",
padding_left: "3px",
for i in 0..10 {
2022-01-01 04:53:37 +00:00
"> hello {i}"
}
2022-01-01 04:53:37 +00:00
}
}
})
}