Function sauron::prelude::svg::svg_element
source · pub fn svg_element<MSG>(
tag: &'static str,
attrs: impl IntoIterator<Item = Attribute<MSG>>,
children: impl IntoIterator<Item = Node<MSG>>
) -> Node<MSG>
Expand description
creates an svg element with the tag, attributes and children. Example:
use sauron::{*, svg::*, svg::attributes::*};
let circle: Node<()> = svg_element("circle", vec![cx(1.0), cy(1.0), r(1.0)], vec![]);
assert_eq!(node!{<circle cx=1.0 cy=1.0 r=1.0></circle>}, circle);