Macro freya::components::import_svg
source ยท macro_rules! import_svg { ($component_name:ident, $path:expr, $width: expr, $height: expr) => { ... }; ($component_name:ident, $path:expr) => { ... }; }
Expand description
Generate a Dioxus component rendering the specified SVG.
Example:
import_svg!(Ferris, "../../../examples/ferris.svg", "100%", "100%");
import_svg!(FerrisWithRequiredSize, "../../../examples/ferris.svg");
fn app() -> Element {
rsx!(Ferris {})
}
fn another_app() -> Element {
rsx!(FerrisWithRequiredSize {
width: "150",
height: "40%",
})
}