View Source Fontawesome (Fontawesome Icons v0.0.8)
To add as a dependency in your mix.exs
:
def deps do
[
{:fontawesome_icons, "~> 0.0.8"}
]
end
Example usage:
<Fontawesome.icon icon="arrow-left" />
<Fontawesome.icon icon="icon2" style="solid" />
<Fontawesome.icon icon="another-icon" weight="sharp" />
<Fontawesome.icon
icon="everything"
style="thin"
weight="sharp"
size="2x"
class="my-css-class"
css="border: 1px solid red;"
phx-click="do-something"
/>
Has a single configuration option allowing you to register the free version only is used. When set this will (try to) override all non-free styling to be free only.
config :fontawesome_icons,
free_only: true
Additionally contains lists of icon names with Fontawesome.regular_icons/0
and Fontawesome.brand_icons/0
Summary
Functions
Returns a list of all the brand icons
Returns a fontawesome icon as a Phoenix.LiveView.Rendered object.
Returns a list of all non-brand icons
The version of FontAwesome this was built against (for the icon lists)
Functions
@spec brand_icons() :: [String.t()]
Returns a list of all the brand icons
@spec icon(map()) :: Phoenix.LiveView.Rendered.t()
Returns a fontawesome icon as a Phoenix.LiveView.Rendered object.
Requires:
icon
: The fontawesome icon you wish to display, you do not need to prefix it with "fa-"
Optional arguments:
style
: regular, solid, light, thin, duotone or brand
weight
: classic or sharp
size
: the fx weight class, you do not need to prefix it with "fa-"
class
: css classes placed into the "class" attribute after the above classes
css
: css placed into the "style" attribute
Attributes
icon
(:string
) (required)style
(:string
) - Defaults to"regular"
.weight
(:string
) - Defaults tonil
.size
(:string
) - Defaults tonil
.class
(:any
) - Defaults tonil
.css
(:string
) - Defaults tonil
. Global attributes are accepted.
@spec regular_icons() :: [String.t()]
Returns a list of all non-brand icons
@spec version() :: String.t()
The version of FontAwesome this was built against (for the icon lists)