This package adds a convenient way of using Font Awesome Pro SVGs with your Phoenix, Phoenix LiveView and Surface applications.
You can find the original docs here and repo here.
Current FontAwesome version: 6.2.1
Add ex_fontawesome
to the list of dependencies in mix.exs
:
def deps do
[
{:ex_fontawesome_pro, git: "https://github.com/carldr/ex_fontawesome_pro"}
]
end
Then run mix deps.get
.
You then need to get the icons from Font Awesome, so we can build ex_fontawesome_pro :
FONTAWESOME_NPM_AUTH_TOKEN=...token... \
EX_FONTAWESOME_PRO=deps/ex_fontawesome_pro \
mix ex_fontawesome_pro
Replacing ...token...
with your token. See https://fontawesome.com/docs/web/setup/packages
for details.
Then this is a bit of a hack - you need to remove your _build
directory so ex_fontawesome_pro
is rebuilt with the icons you've just downloaded.
But once you have, you can compile your app and enjoy pro icons!
<%= FontAwesomePro.icon("rocket-launch", type: "regular", class: "h-4 w-4") %>
<FontAwesomePro.LiveView.icon name="rocket-launch" type="regular" class="h-4 w-4" />
<FontAwesomePro.Surface.Icon name="rocket-launch" type="regular" class="h-4 w-4" />
Defaults can be set in the FontAwesomePro
application configuration.
config :ex_fontawesome_pro, type: "regular"
MIT. See LICENSE for more details.