New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@digieggs/rn-country-code-picker

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@digieggs/rn-country-code-picker

A searchable dropdown component to select a country code for your phone number input.

  • 1.4.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
160
increased by11.11%
Maintainers
2
Weekly downloads
 
Created
Source

React Native Country Code Picker

You can read our article about this package: https://medium.com/digieggs/complete-guide-to-using-country-code-picker-in-your-react-native-projects-daedc55cc4c4

License: MIT npm npm

A searchable dropdown component to select a country code for your phone number input.

For Managed Workflow users using Expo

This component is not supported in the managed workflow for expo for the time being.

Getting started

npm install @digieggs/rn-country-code-picker

or

yarn add @digieggs/rn-country-code-picker

Also you need to manually install react-native-svg and react-native-localize libraries for the icons in the component

npm install react-native-svg react-native-localize

or

yarn add react-native-svg react-native-localize

For react-native@0.60.0 or above

As react-native@0.60.0 or above supports autolinking, so there is no need to run linking process. Read more about autolinking here.

iOS

CocoaPods on iOS needs this extra step

npx pod-install
Android

No additional step is required.

Usage

First of all, import the component.

import { CallingCodePicker } from '@digieggs/rn-country-code-picker';

Then use it like this.

const [selectedCallingCode, setSelectedCallingCode] = useState('');

return <CallingCodePicker onValueChange={callingCode => setSelectedCallingCode(callingCode)} />;

Props


Reference

Props

initialCountryCode

the ISO 3166-1 alpha-2 code (FR, US, CA) of the country that you would like to show initially. If you don't pass a value to this, the country code based on your device locale will be used.

TypeRequired
stringno

onValueChange

Callback for when a country is selected.

  • callingCode: the calling code of the selected country
TypeRequired
functionYes

togglerContainerStyle

Style to apply to the toggler container.

TypeRequired
StylePropNo

togglerLabelStyle

Style to apply to the picker toggler label.

TypeRequired
StylePropNo

listContainerStyle

Style to apply to the list container.

TypeRequired
StylePropNo

searchInputStyle

Style to apply to the search input.

TypeRequired
StylePropNo

listStyle

Style to apply to the FlatList component.

TypeRequired
StylePropNo

pickerItemLabelStyle

Style to apply to each of the item labels.

TypeRequired
StylePropNo

pickerItemContainerStyle

Style to apply to each of the item container.

TypeRequired
StylePropNo

style

Style to apply to container.

TypeRequired
StylePropNo

isFlagVisible

Visibility of flag component.

TypeRequired
booleanNo

Credits

Keywords

FAQs

Package last updated on 30 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc