1
0

svg_basic.rs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. use dioxus::prelude::*;
  2. fn app() -> Element {
  3. rsx! {
  4. svg {
  5. width: "200",
  6. height: "250",
  7. xmlns: "http://www.w3.org/2000/svg",
  8. version: "1.1",
  9. rect {
  10. x: "10",
  11. y: "10",
  12. width: "30",
  13. height: "30",
  14. stroke: "black",
  15. fill: "transparent",
  16. stroke_width: "5",
  17. }
  18. rect {
  19. x: "60",
  20. y: "10",
  21. width: "30",
  22. height: "30",
  23. stroke: "black",
  24. fill: "transparent",
  25. stroke_width: "5",
  26. }
  27. circle {
  28. cx: "25",
  29. cy: "75",
  30. r: "20",
  31. stroke: "red",
  32. fill: "transparent",
  33. stroke_width: "5",
  34. }
  35. ellipse {
  36. cx: "75",
  37. cy: "75",
  38. rx: "20",
  39. ry: "5",
  40. stroke: "red",
  41. fill: "transparent",
  42. stroke_width: "5",
  43. }
  44. line {
  45. x1: "10",
  46. x2: "50",
  47. y1: "110",
  48. y2: "150",
  49. stroke: "orange",
  50. stroke_width: "5",
  51. }
  52. polyline {
  53. points: "60 110 65 120 70 115 75 130 80 125 85 140 90 135 95 150 100 145",
  54. stroke: "orange",
  55. fill: "transparent",
  56. stroke_width: "5",
  57. }
  58. polygon {
  59. points: "50 160 55 180 70 180 60 190 65 205 50 195 35 205 40 190 30 180 45 180",
  60. stroke: "green",
  61. fill: "transparent",
  62. stroke_width: "5",
  63. }
  64. path {
  65. d: "M20,230 Q40,205 50,230 T90,230",
  66. fill: "none",
  67. stroke: "blue",
  68. stroke_width: "5",
  69. }
  70. path {
  71. d: "M9.00001 9C9 62 103.5 124 103.5 178",
  72. stroke: "#3CC4DC",
  73. "stroke-linecap": "square",
  74. "stroke-width": "square",
  75. }
  76. }
  77. }
  78. }
  79. fn main() {
  80. launch(app);
  81. }