freya::components

Macro import_svg

Source
macro_rules! import_svg {
    ($component_name:ident, $path:expr, { $($key:ident : $value:expr),* $(,)? }) => { ... };
}
Expand description

Generate a Dioxus component rendering the specified SVG.

ยงExample


import_svg!(Ferris, "../../../examples/ferris.svg", {
    width: "auto",
    height: "40%",
});

fn app() -> Element {
    rsx!(
        Ferris {
           width: "150",
        }
    )
}