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

react-native-region-country-picker

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-region-country-picker

React native library country picker

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-native-region-country-picker

Various country picker for iOS and Android

Demo

Getting started

$ npm install react-native-region-country-picker --save
OR
$ yarn add react-native-region-country-picker

Example

import CountryPicker from "react-native-region-country-picker";

let countryPickerRef = undefined;

// use countryPickerRef
countryPickerRef.open();
countryPickerRef.close();

<CountryPicker
  countryPickerRef={(ref: any) => {
    countryPickerRef = ref;
  }}
  enable={true}
  darkMode={false}
  countryCode={"US"}
  containerConfig={{
    showFlag: true,
    showCallingCode: true,
    showCountryName: true,
    showCountryCode: true,
  }}
  modalConfig={{
    showFlag: true,
    showCallingCode: true,
    showCountryName: true,
    showCountryCode: true,
  }}
  onSelectCountry={(data: any) => {
    console.log("DATA", data);
  }}
  onInit={(data: any) => {
    console.log("DATA", data);
  }}
  onOpen={() => {
    console.log("Open");
  }}
  onClose={() => {
    console.log("Close");
  }}
  containerStyle={{
    container: {},
    flagStyle: {},
    callingCodeStyle: {},
    countryCodeStyle: {},
    countryNameStyle: {},
  }}
  modalStyle={{
    container: {},
    searchStyle: {},
    tileStyle: {},
    itemStyle: {
      itemContainer: {},
      flagStyle: {},
      countryCodeStyle: {},
      countryNameStyle: {},
      callingNameStyle: {},
    },
  }}
  title={"Country"}
  searchPlaceholder={"Search"}
  showCloseButton={true}
  showModalTitle={true}
/>;

Options

PropsDefaultOptions/Info
enable (Boolean)trueShow component that choose the country.
countryPickerRef (Function)nullGet the open() and close() modal methods.
darkMode (Boolean)trueDark mode for country modal.
countryCode (String)USCountry code displayed is selected at start.
modalConfig (Object)USConfig for component that choose the country.
Note: See more details below.
containerConfig (Object)USConfig for component that choose the country.
Note: See more details below.
onSelectCountry (Function)nullCalled when the user chooses a country and returns information for the selected country.
onInit (Function)nullCalled when the component set default country and returns information for the selected country.
onOpen (Function)nullCalled when the open modal.
onClose (Function)nullCalled when the close modal.
title (String)"Country"The title of the modal select country.
showCloseButton (Boolean)trueShow the close button of the modal select country.
showModalTitle (Boolean)trueShow the title of the modal select country.
containerStyle (Object)nullStyle for component that choose the country.
Note: See more details below.
modalStyle (Object)nullStyle for modal select country.
Note: See more details below.
renderChildren (Component)nullThe child component replaces the component element of the library

containerStyle

PropsDefaultOptions/Info
container (Object)styleStyle for component container.
flagStyle (Object)styleStyle for the icon country.
callingCodeStyle (Object)styleStyle for country code.
countryNameStyle (Object)styleStyle for country name.
countryCodeStyle (Object)styleStyle for country code.

modalConfig && containerConfig

PropsDefaultOptions/Info
showFlag (Boolean)trueShow/hide Flag.
showCallingCode (Boolean)trueShow/hide Calling Code.
showCountryName (Boolean)trueShow/hide Country Name.
showCountryCode (Boolean)trueShow/hide Country Code.

modalStyle

PropsDefaultOptions/Info
container (Object)styleStyle for modal container
searchStyle (Object)styleStyle for modal search input
tileStyle (Object)styleStyle for modal title
itemStyle (Object)styleStyle for item select country
Note: See more details below.

itemStyle

PropsDefaultOptions/Info
itemContainer (Object)styleStyle for item country container
flagStyle (Object)styleStyle for the icon country.
callingCodeStyle (Object)styleStyle for country code.
countryNameStyle (Object)styleStyle for country name.
countryCodeStyle (Object)styleStyle for country code.

Thank you for your interest!

Keywords

FAQs

Package last updated on 20 May 2021

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