Beautiful flag icons for Compose Multiplatform and Android. All flags are provided as a Kotlin Multiplatform library through Composable functions.
FlagKit Compose is a port of the original FlagKit to Kotlin.
The screenshots below show the demo app using different Material You themes on Android, and the demo app on iOS
Android ๐ต๐ธ | Android ๐ฎ๐น | Android ๐ฒ๐ฆ | iOS ๐บ๐ธ |
---|---|---|---|
![]() |
![]() |
![]() |
![]() |
Add FlagKit dependency to your application:
implementation("eu.acolombo.flagkit:flagkit:1.1.1")
If you are using version catalogs:
[versions]
flagkit = "1.1.1"
# โฆ
[libraries]
flagkit = { group = "eu.acolombo.flagkit", name = "flagkit", version.ref = "flagkit" }
# โฆ
You can use the Flag
composable with predefined flags
Flag(
flag = FlagKit.Flag.PS,
shape = RoundedCornerShape(6.dp),
size = DpSize(56.dp, 40.dp),
)
Or simply with a region code string:
Flag(
code = "it",
shape = RoundedCornerShape(6.dp),
size = DpSize(56.dp, 40.dp),
)
There is also an API that closely resembles the original Swift FlagKit API, but itโs not recommended to use since the Compose API is more powerful and flexible:
Flag(
countryCode = "ma",
style = flagkit.FlagStyle.Circle,
)
If needed, you can access the underlying flag assets directly as ImageVector
s:
Image(
imageVector = FlagKit.Flag.MA.image,
contentDescription = null,
)
FlagKit provides over 250 flags. A list of all flags can be found here.
This project rewrites FlagKit for use in Kotlin Multiplatform projects.
If you want to contribute:
โ Fork and adapt the project to your needs
โ Open a Pull Request for improvements
โ Check the issues for bugs or enhancement ideas
- Improve demo app
- Add github preview image + header in README.md
- Add Locale Helpers
- Add Unit and UI tests
FlagKit Compose is released under the MIT license. See LICENSE.