dioxus/examples/tui_list.rs

29 lines
580 B
Rust
Raw Normal View History

2021-12-31 23:53:37 -05:00
use dioxus::prelude::*;
fn main() {
2022-03-09 13:36:30 -05:00
dioxus::tui::launch(app);
2021-12-31 23:53:37 -05: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",
(0..10).map(|i| rsx!(
"> hello {i}"
))
}
}
})
}