Module freya_elements::svg
source · Expand description
svg
element let’s you display SVG code.
For dynamic SVGs you may use dynamic_bytes
.
§Example
ⓘ
static FERRIS: &[u8] = include_bytes!("./ferris.svg");
fn app() -> Element {
let ferris = static_bytes(FERRIS);
rsx!(
svg {
svg_data: ferris,
width: "100%", // You must specify size otherwhise it will default to 0
height: "100%",
}
)
}
Constants§
- The
color
attribute lets you specify the color of the text. - The
fill
andstroke
attributes allows you to specify the fill or stroke color for thesvg
. - Specify the width and height for the given element.
- Specify the margin of an element. You can do so by four different ways, just like in CSS.
- max_width & max_height
- min_width & min_height
- Specify the opacity of an element and all its descendants.
- Specify how you want the element to be positioned inside it’s parent area.
- The
rotate
attribute let’s you rotate an element.