flags
Security covered
Display country and language flag icons alongside your fields in Drupal. The Flags module provides flag icons for both countries and languages using a CSS-sprite for fast loading, with field formatters and a simple API.
Features
- Country and language flags – Flag icons compatible with Country and Language field formatters
- CSS-sprite based – All flags loaded from a single sprite for fast performance
- Field formatters – Display flags in "Manage display" for any supported field type
- Form display – Show flags in select lists via Select Icons or Select2 Boxes
- Language switcher icons – Display flags in language switcher blocks and node forms
- Customizable mappings – Override which flag is used for any country or language via the UI submodule (Administration > Configuration > Regional and language > Flags)
- Simple API – Retrieve flag icons programmatically for custom use cases
Submodules
- Flags Country – Integrates with the Country module field type
- Flags Language – Integrates with core's language field
- Flags Languagefield – Integrates with the Language Field module
- Flags UI – Administration interface to customize flag-to-country/language mappings
Usage
Enable one of the submodules that provides integration with your field type. After enabling, new field formatters for flag icons become available under "Manage display" (and under "Manage form display" when using Select Icons).
Related modules
- Country – Provides a country field type using Drupal core's country list
- Select Icons – Display flag icons in form select lists
- Select2 Boxes – Alternative select list widget with flag support
- Language Display – Required for flag icons on core's language field formatter
Documentation
Full documentation is available in the README file.
🤖 Assisted Development
This module is maintained with the help of AI assistants for code generation, review, testing, and documentation. All code is carefully reviewed by the maintainers to ensure that quality and security standards are met.