Skip to content

Flagpack provides 4x3 country flags as Phoenix.Component.

License

Notifications You must be signed in to change notification settings

marmelasoft/flagpack_elixir

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flagpack

CI Hex Hex Docs

Flagpack provides 4x3 country flags as Phoenix.Component. Based on flagpack.xyz.

The generation of the flags is inspired by heroicons_elixir.

Installation

The package can be installed by adding flagpack to your list of dependencies in mix.exs:

def deps do
  [
    {:flagpack, "~> 0.1.0"}
  ]
end

Usage

Each component accepts an optional class attribute in order to be able to add extra classes to the component.

<Flagpack.usa />
<Flagpack.usa class="w-5 h-5" />

You may use the Flagpack.flag/1 function and pass a flag name. This can be useful when you want to generate the flag name dynamically.

<Flagpack.flag name={:usa}/>
<Flagpack.flag name={:usa} class="w-5 h-5" />

For additional information and list of all flags see the docs.

Naming

The name of a function for a flag is the country's three letter code (ISO 3166-1 alpha-3) in lowercase. You may search for flags here https://flagpack.xyz/docs/flag-index/.

For Andorra we use the country's two letter code (ISO 3166-1 alpha-2) ad, because we are not able to name the function and.

About

Flagpack provides 4x3 country flags as Phoenix.Component.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 100.0%