PHPackages                             ranium/filament-flags-dropdown - 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. ranium/filament-flags-dropdown

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

ranium/filament-flags-dropdown
==============================

Flag dropdown field for Filament forms

v0.2.0(2y ago)110[1 issues](https://github.com/ranium/filament-flags-dropdown/issues)[2 PRs](https://github.com/ranium/filament-flags-dropdown/pulls)MITBladePHP ^8.1

Since Jul 10Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ranium/filament-flags-dropdown)[ Packagist](https://packagist.org/packages/ranium/filament-flags-dropdown)[ Docs](https://github.com/ranium/filament-flags-dropdown)[ RSS](/packages/ranium-filament-flags-dropdown/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (13)Versions (7)Used By (0)

Flags dropdown field for Filament forms
=======================================

[](#flags-dropdown-field-for-filament-forms)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0bacd53c16968b2118d33bd0c39a85ffc18fb137f4f0a9fbba9538b9f0f489bc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72616e69756d2f66696c616d656e742d666c6167732d64726f70646f776e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ranium/filament-flags-dropdown)[![GitHub Tests Action Status](https://camo.githubusercontent.com/522bf78357d777abd108bc5bbd48c39964f43c12a8a72a50164e60bc719549f5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f72616e69756d2f66696c616d656e742d666c6167732d64726f70646f776e2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/ranium/filament-flags-dropdown/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/69db61ac50117d848826cfc673e291487d9b496e78af0e44fe7ff6b410b94917/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f72616e69756d2f66696c616d656e742d666c6167732d64726f70646f776e2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/ranium/filament-flags-dropdown/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/ae2cca936a0bfae1f935e493a636c5ff8033796e61716e3c7235999cd54cef18/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72616e69756d2f66696c616d656e742d666c6167732d64726f70646f776e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ranium/filament-flags-dropdown)

A dropdown field with flags and custom labels. The field can be used as a country or language selector in [Filament forms](https://filamentphp.com/docs/2.x/forms/installation).

This package utilizes [flag-icons](https://github.com/lipis/flag-icons) to display the country flags.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require ranium/filament-flags-dropdown
```

You can publish the config file with (optional):

```
php artisan vendor:publish --tag="filament-flags-dropdown-config"
```

Usage
-----

[](#usage)

You can now use the FlagsDropdown field in your form builder. You need to provide the options to display in the dropdown.

The options array keys should be the [ISO 3166-1-alpha-2 code](https://www.iso.org/obp/ui/#search/code/) of the country and the value should be an array of `value` and `label` for the option. In the following example, `IND`will be saved in the database when `India` is chosen from the dropdown.

```
use Ranium\FlagsDropdown\Forms\Components\Fields\FlagsDropdown;

public static function form(Form $form): Form
{
    $countries = [
        'in' => ['value' => 'IND', 'label' => 'India'],
        'us' => ['value' => 'USA', 'label' => 'United States'],
    ];

    return $form
        ->schema([
            // ... Other fields
            FlagsDropdown::make('country')
                ->options($countries), // Chain your field modifiers here
            // Other fields
        ]);
}
```

If you want the dropdown to have the same `value` as the `label` then your options can be built like this:

```
$countries = [
    'in' => 'India',
    'us' => 'United States'
];
```

In this case the field's value will be "India" when that option is chosen.

### Events

[](#events)

The field fires an event whenever its value is changed. You can listen to the event and bind it to a callable. The new and old values are passed as arguments to the callable.

```
use Filament\Pages\Page;
use Filament\Forms\Concerns\InteractsWithForms;
use Ranium\FlagsDropdown\Forms\Components\Fields\FlagsDropdown;

class Settings extends Page
{
    use InteractsWithForms;

    protected static ?string $navigationIcon = 'heroicon-o-document-text';

    protected static string $view = 'filament.pages.settings';

    protected function getFormSchema(): array
    {
        return [
            FlagsDropdown::make('language')
                ->options(['in' => 'Hindi', 'gb' => 'English'])
                ->onChange($this->doSomething(...)),
        ];
    }

    public function doSomething(?string $newValue, ?string $oldValue)
    {
        // This method will be called whenever the value of the
        // dropdown changes in the frontend
    }
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Abbas Ali](https://github.com/abbasali)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~2 days

Total

2

Last Release

1086d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1827901?v=4)[Ranium Systems](/maintainers/ranium)[@ranium](https://github.com/ranium)

---

Top Contributors

[![abbasali](https://avatars.githubusercontent.com/u/145739?v=4)](https://github.com/abbasali "abbasali (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelraniumfilament-flags-dropdown

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/ranium-filament-flags-dropdown/health.svg)

```
[![Health](https://phpackages.com/badges/ranium-filament-flags-dropdown/health.svg)](https://phpackages.com/packages/ranium-filament-flags-dropdown)
```

###  Alternatives

[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17760.2k3](/packages/stephenjude-filament-jetstream)[stephenjude/filament-debugger

About

104162.2k2](/packages/stephenjude-filament-debugger)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[malzariey/filament-daterangepicker-filter

This package uses daterangepciker library to filter date by a range or predefined date ranges (Today , Yesterday ...etc)

1772.3M23](/packages/malzariey-filament-daterangepicker-filter)[stephenjude/filament-feature-flags

Filament implementation of feature flags and segmentation with Laravel Pennant.

122177.8k1](/packages/stephenjude-filament-feature-flags)

PHPackages © 2026

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