Phone Input

A phone number field: the region and the number, with the value in E.164.

import { PhoneInput } from "@plexui/react-native"

Examples

Overview

Platforms

iOS 27Android
Native componentNone: Settings' Add Phone Number (a region row and a number row in one group)None: an exposed dropdown field over an outlined text field
Region listA sheet: search, the section index, a checkmarkA full-screen dialog with search
DigitsAs typedGrouped as the region writes them

API

PhoneInput

PropTypeDefaultDescription
valuestring—The number in E.164 (+447400123456), or the digits typed so far after the code; "" when empty
defaultValuestring—The first value of an uncontrolled field
onChange(value: string, details: PhoneDetails) => void—Each change: the value and { value, country, text, possible, valid }
countryCountryCode—The region the number is typed in (ISO 3166-1 alpha-2)
defaultCountryCountryCodethe device's region, else "US"The first region of an uncontrolled field
onCountryChange(country: CountryCode) => void—The region changed: picked from the list, or named by a pasted number
countriesCountryCode[]every regionThe regions the list offers
localestringthe device'sThe locale of the regions' names
formattingbooleanfalse on iOS, true on AndroidGroups the digits as the region writes them
flagsbooleanfalseFlags before the regions' names in the list
labelstring"Phone number"The number field's placeholder (iOS), label (Android) and name
countryLabelstring"Country or Region"The region field's name and the list's title
searchPlaceholderstring"Search"The list's search placeholder
headerReactNode—iOS: the group's header
descriptionReactNode—Words under the field (iOS: the group's footer)
errorMessagestring—An error under the field; it marks the field invalid
invalidboolean—Marks the field invalid
disabledbooleanfalseLocks both fields
autoFocus, onBlur, onSubmitEditing, returnKeyTypeTextInputProps—The number field's
testIDstring—Test id
styleStyleProp<ViewStyle>—Style of the field