Display emoji-style flag icons anywhere in your Blade templates with a single component. 250+ countries, 100+ languages. Powered by Twitter Twemoji.
Install the package, use the Blade component anywhere in your views. No config required — it just works.
{{-- Country flag by ISO code --}} <x-flag-icon type="country" code="us" width="24px" height="24px" /> {{-- Dynamic from model --}} <x-flag-icon type="country" code="{{ $user->country_code }}" width="20px" />
{{-- Language flag by ISO code --}} <x-flag-icon type="language" code="bn" width="24px" height="24px" /> {{-- Dynamic locale switcher --}} <x-flag-icon type="language" code="{{ app()->getLocale() }}" width="20px" />
# 1. Install via Composer $ composer require pola5h/laravel-flags # 2. Auto-registered on Laravel 5.5+ # No manual config needed # 3. Use anywhere in Blade <x-flag-icon type="country" code="bd" />
{{-- Locale switcher with flags --}} @foreach ($locales as $locale) <a href="{{ route('locale', $locale) }}"> <x-flag-icon type="language" code="{{ $locale }}" width="18px" /> {{ strtoupper($locale) }} </a> @endforeach
The familiar emoji flag style — consistent across all browsers and platforms. No SVG files to manage.
Simple by design. No dependencies beyond Laravel itself.
Every country in the world is covered using ISO 3166-1 alpha-2 codes. From Afghanistan to Zimbabwe.
Language flags mapped to the primary country for that language. Bengali → Bangladesh, Arabic → Saudi Arabia.
Uses Twitter's Twemoji emoji set — the same friendly flags users see on their phones. Familiar and consistent.
Auto-registered on Laravel 5.5+. Install, use. No publishing, no config files, no setup steps.
Pass width and height as component attributes. Works at any size from tiny inline icons to large display flags.
Completely free, open source, MIT licensed. Use it in any personal or commercial project without restrictions.
composer require pola5h/laravel-flags, then use the component:
<x-flag-icon type="country" code="us" />. Replace us with any
ISO 2-letter country code like bd, gb, or de.
type="language" with an ISO language code:
<x-flag-icon type="language" code="bn" />. Each language maps to the country
most associated with it. Bengali (bn) maps to Bangladesh, Arabic (ar)
maps to Saudi Arabia, and so on.
One composer command and you're done. Free forever.