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

react-country-state-city

Package Overview
Dependencies
Maintainers
0
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-country-state-city

A lightweight and easy-to-use React library that provides a comprehensive list of regions or continents, countries, states, cities languages, and country phone codes for creating dynamic and searchable dropdowns. Ideal for building forms and input fields

  • 1.1.11
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.4K
decreased by-26.55%
Maintainers
0
Weekly downloads
 
Created
Source

React-country-state-city

A lightweight and easy-to-use React library that provides a comprehensive list of regions or continents, countries, states, cities, languages, and country phone codes for creating dynamic and searchable dropdowns. Ideal for building forms and input fields that require accurate and up-to-date geographical selections, with seamless integration for improved user experience.

Installation

$ npm install --save react-country-state-city
$ yarn add react-country-state-city

$ import {
  CitySelect,
  CountrySelect,
  StateSelect,
  LanguageSelect,
  RegionSelect,
  PhonecodeSelect
} from "react-country-state-city";

$ import "react-country-state-city/dist/react-country-state-city.css";

Features

  • Easy to set up for real, you can make it work in less than 1minute!
  • Super easy to customize
  • Can also use it in your own custom UI.
  • Autosuggest: a list of matching countries is displayed when the input text changes.
  • Country data is provided, State data is provided based on given country id, City data is provided based on given country id and state id.
  • Country flag icons.
  • onChange and onTextChange callbacks.
  • And much more !
  • Language dropdown to list and search all languages in English and native too.
  • Regions or Continents dropdown to list and search all the regions from the world.
  • Phonecode dropdown to list and search all the codes based on country name or phone codes.

Data

By default, the control will load the github hosted data files. Alternatively, you can download the data json file and host it yourself. Simply download the JSON files, and supply the src property to each control to tell it where to download from.

Documentation

Read Documentation

Financial Contributors

Buy me a cup of coffee,

Binance Smart Chain or Ethereum - 0x7C6Bfb7f240f6028Fd2a0039924826eD8B879635

Keywords

FAQs

Package last updated on 01 Feb 2025

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