Iconify.SVG (Iconify v0.2.0)

Copy Markdown View Source

SVG rendering utilities for Iconify icons.

Summary

Functions

Returns transformed icon body and viewBox without wrapping it in an SVG element.

Renders an icon as an SVG string.

Functions

build_body(icon, opts \\ [])

@spec build_body(
  Iconify.Icon.t(),
  keyword()
) :: {String.t(), String.t()}

Returns transformed icon body and viewBox without wrapping it in an SVG element.

render(icon, opts \\ [])

@spec render(
  Iconify.Icon.t(),
  keyword()
) :: String.t()

Renders an icon as an SVG string.

Options

  • :class - CSS class(es) to add
  • :id - Element ID
  • :fill - Fill color (default: "currentColor")
  • :stroke - Stroke color
  • :width - Override width
  • :height - Override height
  • :rotate - Additional 90-degree rotations
  • :h_flip - Apply horizontal flip
  • :v_flip - Apply vertical flip
  • Any other options are added as attributes