https://github.com/flo0807/flagpack_elixir
Flagpack provides 4x3 country flags as Phoenix component.
https://github.com/flo0807/flagpack_elixir
elixir elixir-lang phoenix-framework
Last synced: 9 months ago
JSON representation
Flagpack provides 4x3 country flags as Phoenix component.
- Host: GitHub
- URL: https://github.com/flo0807/flagpack_elixir
- Owner: Flo0807
- License: mit
- Created: 2023-01-04T19:43:43.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-16T19:15:03.000Z (9 months ago)
- Last Synced: 2025-04-17T04:20:19.350Z (9 months ago)
- Topics: elixir, elixir-lang, phoenix-framework
- Language: Elixir
- Homepage: https://hex.pm/packages/flagpack
- Size: 843 KB
- Stars: 18
- Watchers: 1
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flagpack
[](https://github.com/Flo0807/flagpack_elixir/actions/workflows/ci.yml)
[](https://hex.pm/packages/flagpack)
[](https://hexdocs.pm/flagpack/Flagpack.html)
Flagpack provides 4x3 country flags as `Phoenix.Component`. Based on [flagpack.xyz](https://flagpack.xyz/).
The generation of the flags is inspired by [heroicons_elixir](https://github.com/mveytsman/heroicons_elixir).
## Installation
The package can be installed by adding `flagpack` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:flagpack, "~> 0.5.0"}
]
end
```
## Usage
Each component accepts an optional class attribute in order to be able to add extra classes to the component.
```eex
```
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.
```eex
```
For additional information and list of all flags see [the docs](https://hexdocs.pm/flagpack/Flagpack.html).
## 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`.