
Bottom sheet
Compact and native.
A polished country calling code picker for Compose Multiplatform with fast search, recent selections, format as you type, and local phone validation.
implementation("io.github.tharukack:countrycodekit:1.1.0")
271 countriesReviewed bundled flags
Instant searchName, ISO, or code
3 presentationsSheet, dialog, full screen
Local validationGoogle metadata
See it in motion
Presentation, your way

Compact and native.

Focused and centered.

Maximum browsing space.
Match the picker to your product.
Format as you type
Show familiar local spacing while keeping a clean phone number value.
+61412 345 678Google metadata
Get possible and valid checks, E.164 output, international formatting, and automatic detection without network requests.
Installation
kotlin {
sourceSets {
commonMain.dependencies {
implementation("io.github.tharukack:countrycodekit:1.1.0")
}
}
}Quick start
val pickerState = rememberCountryCodePickerState()
CountryCodePicker(
state = pickerState,
)
val country = pickerState.selectedCountry
Text(country.formattedCallingCode)API guide
val state = rememberCountryCodePickerState(
initialCountry = CountryCodeCatalog.findByIsoCode("AU")!!,
initialRecentSelections = listOf("NZ", "US"),
)
CountryCodePicker(state = state)
val selected = state.selectedCountryCountryCodePickerstate, modifier, config, enabled, flagContentCountryCodePickerStateselectedCountry, isOpen, query, recentSelectionsState actionsopen(), dismiss(), updateQuery(), select()val config = CountryCodePickerConfig(
style = CountryCodePickerStyle.Dialog,
countryFilter = CountryCodePickerCountryFilter.Supported(
listOf("AU", "NZ", "US")
),
trigger = CountryCodePickerTriggerConfig(...),
countryList = CountryCodePickerCountryListConfig(...),
)stylecountryFiltertriggercountryListbottomSheetdialogfullScreenFilters: All, Supported(isoCodes), or Unsupported(isoCodes).
heightFractiongesturesEnabledshapeshowDragHandleborderWidthtonalElevationminWidth / maxWidthheightshapeborderWidthtonalElevationshadowElevationminWidth / maxWidthdismiss optionscontentMinWidthcontentMaxWidthuseStatusBarPaddinguseNavigationBarPaddingdismissOnBackPressCountryCodePickerCountryListConfig(
showSearch = true,
showCallingCode = true,
showRecentSelections = true,
recentSelectionLimit = 3,
separateCountriesByLetter = true,
autoFocusSearch = false,
flagStyle = CountryCodeFlagStyle.Rounded,
)stringsTitle, search placeholder, section labels, empty state, accessibility labels.searchShape, height, padding, icon sizes, clear button.selectionRow and recent card shapes, borders, spacing, padding, indicators.textStylesTitle, search, sections, country name, calling code, empty state.colorsAccent, surfaces, content, selection, divider, border, scrim.CountryCodePickerTriggerConfig(
triggerElements = setOf(
CountryCodePickerTriggerElement.Flag,
CountryCodePickerTriggerElement.CountryCode,
CountryCodePickerTriggerElement.Chevron,
),
flagStyle = CountryCodeFlagStyle.Circle,
shape = RoundedCornerShape(14.dp),
borderWidth = 1.dp,
)Trigger configElements, flag style, shape, border, text style, chevron, padding, spacing, colors.Flag stylesRounded or Circle.flagContentComposable slot that replaces bundled flags.CountryCodeFlagStandalone bundled flag composable.val phone = rememberCountryCodePhoneState(
initialCountry = CountryCodeCatalog.findByIsoCode("AU")!!,
formatAsYouType = true,
processing = CountryCodePhoneProcessing.ValidateAndDetectCountry,
)
phone.updateNumber(input)
CountryCodePicker(phone.pickerState, config = phone.pickerConfig)InputsinitialCountry, initialNumber, formatAsYouType, processing, validationPreset, pickerConfig, initialRecentSelectionsOutputsrawNumber, selectedCountry, validation, isValid, e164, internationalProcessingNone, Validate, DetectCountry, ValidateAndDetectCountryval formatted = CountryCodePhoneFormatter.format(
number = "0412345678",
country = state.selectedCountry,
format = CountryCodePhoneFormat.International,
)
val live = CountryCodePhoneFormatter.formatAsYouType(
number = "0412345678",
country = state.selectedCountry,
)NationalInternationalE164Rfc3966normalizeInput()format()formatAsYouType()val result = CountryCodePhoneValidator.validate(
number = phoneNumber,
country = state.selectedCountry,
preset = CountryCodePhoneValidationPreset.PhoneNumber,
)
if (result.isValid) submit(result.e164)PhoneNumberFull country aware validation.PossibleLengthPossible length for the selected country.DigitsOnlyASCII digits only.DigitsAndPossibleLengthDigits plus possible country length.CustomLength(range, digitsOnly)Application defined length rule.isoCodenamecallingCodeformattedCallingCodecountriesfindByIsoCode()search()hasBundledFlag()statusisValide164internationalnormalizedDigitsdetectedCountryEMPTYINVALID_REGIONNOT_A_NUMBERNON_DIGIT_CHARACTERSTOO_SHORT / TOO_LONGIMPOSSIBLE / INVALID / VALIDBuilt for shared UI
Ready to ship?