Kwik Phone Number Field
A powerful phone number field that allows the user to select a country code from a list of countries. The field is outlined and has a leading icon that shows the selected country code. The field also has a trailing icon that shows a check mark if the phone number is valid.
Parameters
The current value of the field
The callback that is called when the value of the field changes
The callback that is called when the keyboard done button is clicked
The label of the field
The shape of the field
Whether the field is in an error state
The error message to show when the field is in an error state
Whether the field should be single line
The maximum number of lines the field can have
The action that should be performed when the keyboard done button is clicked
The initial country info to show in the field
Whether the phone number is valid
Whether the field is enabled
Whether the country code is selectable
The colors of the field
The callback that is called when a country is selected
The title of the country picker dialog
Whether to show the flags of the countries in the country picker dropdown button
Whether to show the country code in the country picker dropdown button
Whether to show the dialing code in the country picker dropdown button
Example usage:
val value = remember { mutableStateOf(TextFieldValue("1234567890")) }
KwikPhoneNumberField(
value = value,
onValueChange = {
value.value = it
},
onKeyboardDone = {},
placeholder = "Phone number",
initialCountryInfo = countryList.random()
onCountrySelected = {},
isValid = true
)