BitstylesPhoenix.Components.Icon (bitstyles_phoenix v0.1.0) View Source

An SVG icon system, that expects the icons to be present on the page, rendered as SVG <symbol>s.

Link to this section Summary

Functions

Renders an icon element.

Link to this section Functions

Link to this function

ui_icon(name, opts \\ [])

View Source

Renders an icon element.

opts[:name] — The name of the icon to render. This must be present in the SVG that renders all the icons in the top of the body e.g. _svgs.html.eex as a <symbol> containing one filled path.

Examples

iex> doctest_ui_component ui_icon("right") ~s(<svg alt="" class="a-icon" role="presentation"><use xlink:href="#icon-right"></svg>)

iex> doctest_ui_component ui_icon("right", size: "s") ~s(<svg alt="" class="a-icon a-icon--s" role="presentation"><use xlink:href="#icon-right"></svg>)

iex> doctest_ui_component ui_icon("trashcan") ~s(<svg alt="" class="a-icon" role="presentation"><use xlink:href="#icon-trashcan"></svg>)