
Flag icons in ImageVector format to use in Kotlin Multiplatform.
With heavy inspiration from the FlagKit and flagkit-android libraries.
Platform Support
- Android
- Desktop
- iOS
- MacOS Native
- Web (JSCanvas)
- WebAssembly (Wasm)
To use in your project
Add the repository:
repositories {
mavenCentral()
}
Put in your dependencies block:
implementation("dev.carlsen.flagkit:flagkit:1.1.0")
How to use
Country flags can be referenced by the Alpha-2 code for each country.
There are also a few other flags available.
Use Flag directly
Image(
imageVector = FlagIcons.DK,
contentDescription = "Denmark",
)
Lookup flag by country code
Image(
imageVector = FlagKit.getFlag(countryCode = "DK"),
contentDescription = "Denmark",
)