Closed i-am-the-slime closed 6 years ago
Specifically, you just want to create an element with the svg namespace https://github.com/kwohlfahrt/purescript-halogen-svg/blob/master/src/Svg/Core.purs#L14
Okay it took me a while to figure this out but I'll leave this here for posterity (I needed the tip you gave here: https://github.com/slamdata/purescript-halogen/issues/363 about using attr
over prop
).
H.elemWithNS
ns
"svg"
[ H.attr "width" "200"
, H.attr "height" "200"
]
[ H.elemWithNS ns "circle"
[ H.attr "cx" "10"
, H.attr "cy" "10"
, H.attr "r" "2"
, H.attr "fill" "red"
] []
]
where
ns = Just $ Namespace "http://www.w3.org/2000/svg"
Since both Halogen and Spork use halogen-vdom, you would do it the same way as you would in Halogen https://github.com/kwohlfahrt/purescript-halogen-svg