tui_margin.rs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. use dioxus::prelude::*;
  2. fn main() {
  3. dioxus::tui::launch(app);
  4. }
  5. fn app(cx: Scope) -> Element {
  6. cx.render(rsx! {
  7. div {
  8. width: "100%",
  9. height: "100%",
  10. flex_direction: "column",
  11. background_color: "black",
  12. // margin_right: "10px",
  13. div {
  14. width: "70%",
  15. height: "70%",
  16. background_color: "green",
  17. // margin_left: "4px",
  18. div {
  19. width: "100%",
  20. height: "100%",
  21. margin_top: "2px",
  22. margin_bottom: "2px",
  23. margin_left: "2px",
  24. margin_right: "2px",
  25. flex_shrink: "0",
  26. background_color: "red",
  27. justify_content: "center",
  28. align_items: "center",
  29. flex_direction: "column",
  30. // padding_top: "2px",
  31. // padding_bottom: "2px",
  32. // padding_left: "4px",
  33. // padding_right: "4px",
  34. "[A]"
  35. "[A]"
  36. "[A]"
  37. "[A]"
  38. }
  39. }
  40. }
  41. })
  42. }