Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Android docs
FormsAndroid

Phone input

Enter an international phone number with searchable countries, calling codes, formatting, validation, and E.164 output.

Public APILumenPhoneInputAndroid / Compose

Native example

Use Phone input

Use for international phone entry that needs discoverable country selection and a validated E.164 result. Persist or dial e164 only when isValid is true.

Phone input rendered in the Android phone emulator Lumen playground
Verified runtime captureAndroid phone emulator
kotlin
@Composable
fun CareTeamPhoneField() {
    val defaultCountry = remember {
        requireNotNull(LumenPhoneCountries.forRegion("CO"))
    }
    var phone by remember {
        mutableStateOf(LumenPhoneNumber.empty(defaultCountry))
    }

    LumenPhoneInput(
        label = "Hospital or OB phone number",
        value = phone,
        onValueChange = { phone = it }
    )
}

Reference

Public API

The primary shared and platform-specific options exposed by LumenPhoneInput.

APIValues or typeDefaultDescription
value / onValueChangeLumenPhoneNumber / callbackRequiredControls the country, editable national number, validity, and normalized E.164 result.
countriesPlatform country collectionGenerated metadataPopulates the searchable country picker.
localePlatform localeCurrent localeLocalizes generated country names and international paste resolution.
description / errorMessageString?nullProvides supporting text or an application-owned validation message.
invalidNumberMessageStringEnter a complete phone number.Localizes metadata-backed invalid-number feedback.
showValidationErrorBooleantrueLets the application defer invalid-number feedback until its chosen interaction boundary.
enabled / requiredBooleantrue / falseControls native disabled and required presentation.

Native behavior

Design and accessibility

When to use it

Use for international phone entry that needs discoverable country selection and a validated E.164 result. Persist or dial e164 only when isValid is true.

Accessibility

The country selector announces the localized country name and calling code. Flags supplement visible text and are never the only country identifier.

Shared component

Available on other platforms

React NativeApple / SwiftUI
Android docsCompose module