PHPackages                             lipis/flag-icons - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lipis/flag-icons

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lipis/flag-icons
================

A curated collection of all country flags in SVG — plus the CSS for easier integration.

v7.5.0(11mo ago)12.0k27.5k↑90.6%1.9k[4 issues](https://github.com/lipis/flag-icons/issues)[15 PRs](https://github.com/lipis/flag-icons/pulls)4MITHTMLCI passing

Since Jun 16Pushed 1mo ago149 watchersCompare

[ Source](https://github.com/lipis/flag-icons)[ Packagist](https://packagist.org/packages/lipis/flag-icons)[ Docs](https://flagicons.lipis.dev)[ RSS](/packages/lipis-flag-icons/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)DependenciesVersions (84)Used By (4)

flag-icons
==========

[](#flag-icons)

> A curated collection of all country flags in SVG — plus the CSS for easier integration. See the [demo](https://flagicons.lipis.dev).

Install
-------

[](#install)

You can either [download](https://github.com/lipis/flag-icons/archive/main.zip) the whole project as is or install it via npm or Yarn:

```
npm install flag-icons
# or
yarn add flag-icons
```

Usage
-----

[](#usage)

First, you need to import css:

```
import "/node_modules/flag-icons/css/flag-icons.min.css";
```

or use CDN:

```

```

or use SASS:

```
@use "node_modules/flag-icons/sass/flag-icons";

// or with custom configuration
@use "node_modules/flag-icons/sass/flag-icons" with (
  // Override path to flags directory
  $flag-icons-path: "node_modules/flag-icons/flags",

  // Include only specific country flags
  $flag-icons-included-countries: ("gr", "de", "gb")
);
```

You can find all available variables in [`sass/_variables.scss`](sass/_variables.scss).

For using the flags inline with text add the classes `.fi` and `.fi-xx` (where `xx` is the [ISO 3166-1-alpha-2 code](https://www.iso.org/obp/ui/#search/code/) of a country) to an empty ``. If you want to have a squared version flag then add the class `fis` as well. Example:

```

```

You could also apply this to any element, but in that case you'll have to use the `fib` instead of `fi` and you're set. This will add the correct background with the following CSS properties:

```
background-size: contain;
background-position: 50%;
background-repeat: no-repeat;
```

Which means that the flag is just going to appear in the middle of an element, so you will have to set manually the correct size of 4 by 3 ratio or if it's squared add also the `flag-icon-squared` class.

Development
-----------

[](#development)

Run the `yarn` to install the dependencies after cloning the project and you'll be able to:

To build `*.scss` files

```
$ yarn build
```

To serve it on `localhost:8000`

```
$ yarn start
```

To have only specific countries in the css file, remove the ones that you don't need from the [`_flag-icons-list.scss`](sass/_flag-icons-list.scss) file and build it again.

Credits
-------

[](#credits)

- This project wouldn't exist without the awesome and now deleted collection of SVG flags by [koppi](https://github.com/koppi).
- Thank you [Andrejs Abrickis](https://twitter.com/andrejsabrickis) for providing the `flag-icons` name on [npm](https://www.npmjs.com/package/flag-icons).

###  Health Score

68

—

FairBetter than 100% of packages

Maintenance72

Regular maintenance activity

Popularity64

Solid adoption and visibility

Community46

Growing community involvement

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 55.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~54 days

Recently: every ~33 days

Total

74

Last Release

354d ago

Major Versions

0.8.6 → 1.0.02015-12-25

1.4.0 → 2.0.02016-04-12

2.9.0 → 3.0.02018-02-22

3.5.0 → v6.8.02023-07-24

v6.15.0 → v7.0.02023-11-17

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8895528?v=4)[Mistralys](/maintainers/Mistralys)[@Mistralys](https://github.com/Mistralys)

---

Top Contributors

[![lipis](https://avatars.githubusercontent.com/u/125676?v=4)](https://github.com/lipis "lipis (611 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (256 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (105 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (27 commits)")[![NotTsunami](https://avatars.githubusercontent.com/u/4589807?v=4)](https://github.com/NotTsunami "NotTsunami (22 commits)")[![greenkeeperio-bot](https://avatars.githubusercontent.com/u/14790466?v=4)](https://github.com/greenkeeperio-bot "greenkeeperio-bot (15 commits)")[![2009](https://avatars.githubusercontent.com/u/811241?v=4)](https://github.com/2009 "2009 (10 commits)")[![RobinvanderVliet](https://avatars.githubusercontent.com/u/692029?v=4)](https://github.com/RobinvanderVliet "RobinvanderVliet (6 commits)")[![mdxs](https://avatars.githubusercontent.com/u/1143642?v=4)](https://github.com/mdxs "mdxs (5 commits)")[![xavier2k6](https://avatars.githubusercontent.com/u/42386382?v=4)](https://github.com/xavier2k6 "xavier2k6 (4 commits)")[![greenkeeper[bot]](https://avatars.githubusercontent.com/in/505?v=4)](https://github.com/greenkeeper[bot] "greenkeeper[bot] (4 commits)")[![markvantilburg](https://avatars.githubusercontent.com/u/4510245?v=4)](https://github.com/markvantilburg "markvantilburg (4 commits)")[![Danny-Engelman](https://avatars.githubusercontent.com/u/3382713?v=4)](https://github.com/Danny-Engelman "Danny-Engelman (3 commits)")[![gucr](https://avatars.githubusercontent.com/u/6040008?v=4)](https://github.com/gucr "gucr (3 commits)")[![Designer023](https://avatars.githubusercontent.com/u/1415767?v=4)](https://github.com/Designer023 "Designer023 (3 commits)")[![bcaller](https://avatars.githubusercontent.com/u/5838651?v=4)](https://github.com/bcaller "bcaller (3 commits)")[![oller](https://avatars.githubusercontent.com/u/1219831?v=4)](https://github.com/oller "oller (2 commits)")[![jorgemoya](https://avatars.githubusercontent.com/u/196129?v=4)](https://github.com/jorgemoya "jorgemoya (2 commits)")[![markesaaremets](https://avatars.githubusercontent.com/u/5947909?v=4)](https://github.com/markesaaremets "markesaaremets (2 commits)")[![colinj](https://avatars.githubusercontent.com/u/272865?v=4)](https://github.com/colinj "colinj (2 commits)")

---

Tags

countrycountry-flagscssicon-csssvgcsssvgcountrycountry flagsicon-css

### Embed Badge

![Health badge](/badges/lipis-flag-icons/health.svg)

```
[![Health](https://phpackages.com/badges/lipis-flag-icons/health.svg)](https://phpackages.com/packages/lipis-flag-icons)
```

###  Alternatives

[components/flag-icon-css

A curated collection of all country flags in SVG — plus the CSS for easier integration.

12.0k1.6M23](/packages/components-flag-icon-css)[rinvex/countries

Rinvex Countries is a simple and lightweight package for retrieving country details with flexibility. A whole bunch of data including name, demonym, capital, iso codes, dialling codes, geo data, currencies, flags, emoji, and other attributes for all 250 countries worldwide at your fingertips.

1.7k7.4M48](/packages/rinvex-countries)[matthiasmullie/minify

CSS &amp; JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.

2.0k30.5M336](/packages/matthiasmullie-minify)[scssphp/scssphp

scssphp is a compiler for SCSS written in PHP.

62827.7M220](/packages/scssphp-scssphp)[wikimedia/less.php

PHP port of the LESS processor

12327.4M77](/packages/wikimedia-lessphp)[stidges/country-flags

A small package to convert a country code to the corresponding country flag emoji

29256.6k4](/packages/stidges-country-flags)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
