Function sauron_core::html::html_element_ns [−][src]
pub fn html_element_ns<MSG>(
tag: &'static str,
namespace: &'static str,
attrs: Vec<Attribute<MSG>>,
children: Vec<Node<MSG>>
) -> Node<MSG>
Expand description
Creates an html element with the element tag name and namespace This is specifically used for creating svg element where a namespace is needed, otherwise the browser will not render it correctly.
Examples
use sauron::prelude::*; let html:Node<()> = html_element_ns("svg","http://www.w3.org/2000/svg", vec![width(200), height(200), xmlns("http://www.w3.org/2000/svg")], vec![]); assert_eq!(node!{<svg width=200 height=200 xmlns="http://www.w3.org/2000/svg"></svg>}, html);