Docyrus

PhoneInput

Phone number input with country code picker and search.

iOSAndroid
Preview PhoneInput on your device

Scan with Expo Go

Download Expo Go, then scan the QR code to preview native components.

Installation

pnpm dlx @docyrus/cli add @docyrus/rn-phone-input

Usage

import { PhoneInput } from '@/components/docyrus-native/phone-input';

<PhoneInput
  value={phone}
  onValueChange={setPhone}
  countryCode={country}
  onCountryCodeChange={setCountry}
/>

API Reference

PropTypeDefaultDescription
valuestring''Phone number
onValueChange(value: string) => void—Value change handler
countryCodestring'US'Selected country code
onCountryCodeChange(code: string) => void—Country change handler
countriesCountryCode[]15 defaultsCountry list
placeholderstring'Phone number'Placeholder text
disabledbooleanfalseDisable interaction
invalidbooleanfalseShow invalid state
size'sm' | 'md' | 'lg''md'Input size
classNamestring—Additional CSS classes
inputClassNamestring—TextInput CSS classes
accessibilityLabelstring—Accessibility label

CountryCode

PropertyTypeDescription
codestringISO country code (e.g. 'US')
dialCodestringDial code (e.g. '+1')
flagstringFlag emoji
namestringCountry name

Type Exports

TypeDescription
PhoneInputPropsProps for PhoneInput component
PhoneInputSize'sm' | 'md' | 'lg'
CountryCodeCountry code entry type

On this page