A phone number field: the region and the number, with the value in E.164.
import { PhoneInput } from "@plexui/react-native"
| iOS 27 | Android |
|---|
| Native component | None: 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 list | A sheet: search, the section index, a checkmark | A full-screen dialog with search |
| Digits | As typed | Grouped as the region writes them |
| Prop | Type | Default | Description |
|---|
value | string | — | The number in E.164 (+447400123456), or the digits typed so far after the code; "" when empty |
defaultValue | string | — | The first value of an uncontrolled field |
onChange | (value: string, details: PhoneDetails) => void | — | Each change: the value and { value, country, text, possible, valid } |
country | CountryCode | — | The region the number is typed in (ISO 3166-1 alpha-2) |
defaultCountry | CountryCode | the 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 |
countries | CountryCode[] | every region | The regions the list offers |
locale | string | the device's | The locale of the regions' names |
formatting | boolean | false on iOS, true on Android | Groups the digits as the region writes them |
flags | boolean | false | Flags before the regions' names in the list |
label | string | "Phone number" | The number field's placeholder (iOS), label (Android) and name |
countryLabel | string | "Country or Region" | The region field's name and the list's title |
searchPlaceholder | string | "Search" | The list's search placeholder |
header | ReactNode | — | iOS: the group's header |
description | ReactNode | — | Words under the field (iOS: the group's footer) |
errorMessage | string | — | An error under the field; it marks the field invalid |
invalid | boolean | — | Marks the field invalid |
disabled | boolean | false | Locks both fields |
autoFocus, onBlur, onSubmitEditing, returnKeyType | TextInputProps | — | The number field's |
testID | string | — | Test id |
style | StyleProp<ViewStyle> | — | Style of the field |