dioxus/packages/tui/examples/margin.rs

51 lines
1.2 KiB
Rust
Raw Normal View History

2022-01-01 06:08:31 +00:00
use dioxus::prelude::*;
fn main() {
dioxus_tui::launch(app);
2022-01-01 06:08:31 +00:00
}
fn app(cx: Scope) -> Element {
cx.render(rsx! {
div {
width: "100%",
height: "100%",
flex_direction: "column",
background_color: "black",
margin_right: "10px",
2022-01-01 06:08:31 +00:00
div {
width: "70%",
height: "70%",
background_color: "green",
margin_left: "4px",
2022-01-01 06:08:31 +00:00
div {
width: "100%",
height: "100%",
margin_top: "2px",
margin_bottom: "2px",
margin_left: "2px",
margin_right: "2px",
2022-01-12 14:40:36 +00:00
flex_shrink: "0",
2022-01-01 06:08:31 +00:00
background_color: "red",
justify_content: "center",
align_items: "center",
flex_direction: "column",
padding_top: "2px",
padding_bottom: "2px",
padding_left: "4px",
padding_right: "4px",
2022-01-01 06:08:31 +00:00
"[A]"
"[A]"
"[A]"
"[A]"
}
}
}
})
}