CarbonPhoenix.Icons (carbon_phoenix v0.1.1)

Copy Markdown View Source

Compile-time lookup of the Carbon icons.

The 32px SVGs from the @carbon/icons npm package (install it in your app: npm install --prefix assets @carbon/icons) are read at compile time and stored as a map of icon name to inner SVG markup. They scale to any size, so only the 32px variant is embedded.

If the npm package is not installed when compiling, the lookup is empty and CarbonPhoenix.CoreComponents.icon/1 renders an empty <svg>.

Summary

Functions

Returns the inner SVG markup for the icon name, or nil.

Lists all available icon names.

Functions

get(name)

@spec get(String.t()) :: String.t() | nil

Returns the inner SVG markup for the icon name, or nil.

names()

@spec names() :: [String.t()]

Lists all available icon names.