Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-dropdown-country-picker

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-dropdown-country-picker

React Native Dropdown Country Picker is same as that of HTML select list

  • 1.0.11
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
383
increased by55.06%
Maintainers
0
Weekly downloads
 
Created
Source
NPM VERSIONNPM WEEKLY DOWNLOADSGITHUB STARYOUTUBE VIEWSNPM LIFETIME DOWNLOADS

🏳️‍🌈 React Native Dropdown Country Picker

🟢 React Native Dropdown Country Picker Similar as HTML Select List. It's not a modal.

Light Weight and Robust Country Picker So Far.
  • Equivalent to React Native Stock Component
  • Use the styles of your choice
  • Search the countries seamlessly
  • Option to add customizable input mobile field next to the Picker
  • Zero dependencies

Compatibility

iOSAndroidWebExpo

🔌 Installation

$ npm install react-native-dropdown-country-picker

OR

$ yarn add react-native-dropdown-country-picker

😎 Displaying the country picker

import CountryCodeDropdownPicker from 'react-native-dropdown-country-picker'

const App = () => {
  const [selected, setSelected] = React.useState('+91');
  const [country, setCountry] = React.useState('');
  const [phone, setPhone] = React.useState('');

  return(
    <CountryCodeDropdownPicker 
        selected={selected} 
        setSelected={setSelected}
        setCountryDetails={setCountry} 
        phone={phone} 
        setPhone={setPhone} 
        countryCodeTextStyles={{fontSize: 13}}
      />
  )

};

For Live Demo (Expo Snack)

⭐ Props for the component

NameTypeDescriptionDefault
selectedstate varThe default selected country dial code stored in state variableN/A
setSelectedFunctionsetState function to set the selected state variableN/A
setCountryDetailsFunctionsetState function to set additional country details in respective state variable (Optional)N/A
phonestate varstate variable if you want to display phone number field (Optional)N/A
setPhoneFuntionsetState function to set the phone state variable (Optional)N/A
countryCodeContainerStylesstyle Objectstyle object to style the country code container (Optional)N/A
countryCodeTextStylesstyle objectstyle object to style the text inside country code container (Optional)N/A
phoneStylesstyle objectstyle object to style the text input of phone field (Optional)N/A
searchIconstringURL of the icon if you want to replace the search icon (Optional)N/A
closeIconstringURL of the icon if you want to replace the close icon (Optional)N/A
searchStylesstyle objectstyle object to style the search field (Optional)N/A
searchTextStylesstyle objectstyle object to style the search text input field (Optional)N/A
dropdownStylesstyle objectstyle object to style the dropdown container (Optional)N/A
dropdownTextStylesstyle objectstyle object to style the text inside dropdown container (Optional)N/A

▶️ Watch Tutorial Video -->

Watch video

Keywords

FAQs

Package last updated on 29 Jul 2024

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