Hello all!
I just released the first version of my newest elixir package flagpack. With flagpack you can easily integrate country flags into your application.
Links
- flagpack | Hex
- GitHub - Flo0807/flagpack_elixir: Flagpack provides 4x3 country flags as Phoenix.Component.
Overview
The library is based on flagpack.xyz and provides 250+ precompiled flags as Phoenix.Component
.
Each flag can be inserted into existing heex templates by calling the corresponding function for a flag. The name of a flags function is the country’s three letter code (ISO 3166-1 alpha-3) in lowercase.
You can search for countries and it’s code here: Docs - Flag Index — Flagpack
In addition you are able to use the Flagpack.flag/1
function with the name
attribute. This may be useful when displaying flags dynamically. Furthermore you can pass an optional class
attribute to all functions to add additional classes to the flags (e.g. the width and height).
Examples
<Flagpack.usa />
<Flagpack.usa class="w-5 h-5" />
<Flagpack.flag name={:usa}/>
<Flagpack.flag name={:usa} class="w-5 h-5" />
Each flag is designed on a 32x24 grid with an aspect ratio of 4:3.
Any feedback is appreciated!
Best regards!