Skip to content

๐ŸŽŒ Beautiful flag icons for Compose Multiplatform and Android. All flags are provided as a Kotlin Multiplatform library through Composable functions

License

Notifications You must be signed in to change notification settings

acolombo11/flagkit-compose

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

FlagKit Compose

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.

๐Ÿ“ธ Screenshots

The screenshots below show the demo app using different Material You themes on Android, and the demo app on iOS

Android ๐Ÿ‡ต๐Ÿ‡ธ Android ๐Ÿ‡ฎ๐Ÿ‡น Android ๐Ÿ‡ฒ๐Ÿ‡ฆ iOS ๐Ÿ‡บ๐Ÿ‡ธ
Android-PS Android-IT Android-MA iOS-US

โš™๏ธ Setupย  Maven Central Version

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" }
# โ€ฆ

๐Ÿ› ๏ธ Usage

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 ImageVectors:

Image(
    imageVector = FlagKit.Flag.MA.image,
    contentDescription = null,
)

๐Ÿ“š Reference

FlagKit provides over 250 flags. A list of all flags can be found here.

๐Ÿค Contributing

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

Todo

  • Improve demo app
  • Add github preview image + header in README.md
  • Add Locale Helpers
  • Add Unit and UI tests

๐Ÿ“„ License

FlagKit Compose is released under the MIT license. See LICENSE.

About

๐ŸŽŒ Beautiful flag icons for Compose Multiplatform and Android. All flags are provided as a Kotlin Multiplatform library through Composable functions

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Kotlin 100.0%