Skip to content

Repository files navigation

Flagpack

CIHexHex 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:

defdepsdo[{:flagpack,"~> 0.6.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.usaid="my-flag"/><Flagpack.usaclass="size-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.flagname={:usa}/><Flagpack.flagname={:usa}id="my-flag"/><Flagpack.flagname={:usa}class="size-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.

Topics

Resources

Stars

19 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages