Skip to content

YigitEkin/React-Native-Phone-Code-Picker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React-Native-Phone-Code-Picker-Component

This is a customizable React Native component that provides a phone area code picker for your mobile app. The component allows users to select their country and get the associated area code.

Screenshot 2023-03-13 at 13 34 48

Simulator Screen Shot - iPhone 14 Pro Max - 2023-03-13 at 13 32 13

Features

  • Provides a modal which contains a list of countries to select from
  • Displays the selected country's flag and area code
  • Supports filtering of countries by name or code
  • Easily customizable styles and themes
  • Formatting of the selected country's phone number

Screenshot 2023-03-13 at 13 34 36

Usage

Here is a simple example of how to use the component:

function MyComponent() {
  const [phoneNumber, setPhoneNumber] = useState(null);

  return (
    <PhoneAreaCodePicker
      phoneNumber={phoneNumber}
      setPhoneNumber={setPhoneNumber}
    />
  );
}

The setPhoneNumber prop is a callback that will be called when the user selects a country. This event is fired when the user selects a country from the modal. The selectedCountry prop should be a country object with the following structure:

  {
    name: "Turkey",
    flag: "🇹🇷",
    code: "TR",
    dial_code: "+90"
  },

You can also customize the styles and theme of the component by passing in additional props:

<PhoneAreaCodePicker
...
style={{
    container: { marginTop: 16 },
    input: { fontSize: 18 },
    ...
  }}
/>

this repository is made for the project VYBE. Hence the default styling is made for the project. You can change the styling as you wish.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published