diff options
Diffstat (limited to 'test-apps/svg/src/app.gleam')
-rw-r--r-- | test-apps/svg/src/app.gleam | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test-apps/svg/src/app.gleam b/test-apps/svg/src/app.gleam new file mode 100644 index 0000000..4b0b8b2 --- /dev/null +++ b/test-apps/svg/src/app.gleam @@ -0,0 +1,35 @@ +import lustre +import lustre/attribute.{attribute} +import lustre/element/html +import lustre/element/svg +import lustre/ui +import lustre/ui/icon + +pub fn main() { + let styles = [#("width", "100vw"), #("height", "100vh"), #("padding", "1rem")] + + lustre.element(ui.centre( + [attribute.style(styles)], + html.svg( + [ + attribute("version", "1.1"), + attribute("viewBox", "0 0 300 200"), + attribute("width", "300"), + attribute("height", "200"), + ], + [ + svg.rect([ + attribute("width", "100%"), + attribute("height", "100%"), + attribute("fill", "red"), + ]), + svg.circle([ + attribute("cx", "150"), + attribute("cy", "100"), + attribute("r", "80"), + attribute("fill", "green"), + ]), + ], + ), + )) +} |