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 { }
FerrisWithRequiredSize {
width: "50%",
height: "50%",
}
)
}