Skip Navigation
Type MethodMethod

referringSVG(_:identifier:keepingViewBox:)

Returns an SVG element that draws a defined icon: the icon’s classes and a <use> element referring to its definition.

static func referringSVG(
    _ svg: String,
    identifier: String,
    keepingViewBox: Bool = false
) -> String

Parameters

svg

The complete SVG element of the icon.

identifier

The identifier of the icon’s definition.

keepingViewBox

Whether the element keeps the icon’s view box, which gives it the icon’s aspect ratio where the stylesheet sets only one dimension.

Return Value

The referring SVG element.