tui_quadrants.rs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. div {
  12. width: "100%",
  13. height: "50%",
  14. flex_direction: "row",
  15. div {
  16. border_width: "1px",
  17. width: "50%",
  18. height: "100%",
  19. background_color: "red",
  20. justify_content: "center",
  21. align_items: "center",
  22. "[A]"
  23. }
  24. div {
  25. width: "50%",
  26. height: "100%",
  27. background_color: "black",
  28. justify_content: "center",
  29. align_items: "center",
  30. "[B]"
  31. }
  32. }
  33. div {
  34. width: "100%",
  35. height: "50%",
  36. flex_direction: "row",
  37. div {
  38. width: "50%",
  39. height: "100%",
  40. background_color: "green",
  41. justify_content: "center",
  42. align_items: "center",
  43. "[C]"
  44. }
  45. div {
  46. width: "50%",
  47. height: "100%",
  48. background_color: "blue",
  49. justify_content: "center",
  50. align_items: "center",
  51. "[D]"
  52. }
  53. }
  54. }
  55. })
  56. }