svg!() { /* proc-macro */ }
Expand description
Embeds an SVG from Iconify. For a list of icons, see Iconify Icon Sets.
§Usage
The first argument is the icon’s package and name, separated by a colon.
let svg = iconify::svg!("mdi:home");
println!("{}", svg);
Additional optional arguments can also be passed to the macro to customize the SVG.
color = <str>
- Sets the color of the SVG. This can be any valid CSS color.
width = <str>
- Sets the width of the SVG. This can be any valid CSS width.
- If this is not set, the SVG will be rendered at 1em.
height = <str>
- Sets the height of the SVG. This can be any valid CSS height.
- If this is not set, the SVG will be rendered at 1em.
flip = <str>
- Flips the SVG horizontally, vertically, or both.
- Available values: “horizontal”, “vertical”, “both”
rotate = <str>
- Rotates the SVG by the given amount.
- Available values: “90”, “180”, “270”
view_box = <bool>
- If set to true, the SVG will include an invisible bounding box.
iconify::svg!(
"pack:name",
color = "red",
width = "128px",
height = "128px",
flip = "horizontal",
rotate = "90",
view_box = true
)