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

react-country-dropdown

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-country-dropdown

A simple react country selection dropdown component

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
916
increased by16.39%
Maintainers
0
Weekly downloads
 
Created
Source

react-country-dropdown

A simple react country selection dropdown component.

No external dependencies, just a clean functional component.

npm npm

Demo Screenshot

Install

npm i react-country-dropdown

Usage

Check the full documentation and demo here.

import ReactCountryDropdown from "react-country-dropdown";

const Example = () => {
	return (
		<ReactCountryDropdown
			defaultCountry="JP"
			onSelect={(country) => console.log(country.name)}
		/>
	);
};

API

The <ReactCountryDropdown/> component accepts only two props.

Props:

NameTypeRequiredDefaultDescription
defaultCountrystringYesnullThe default country code to be selected.
onSelectfuncYesnullCallback function when a country is selected. Returns the country object.
Country Object:
{
	"name": "Japan",
	"code": "JP",
	"code2": "JPN",
	"capital": "Tokyo",
	"region": "Asia",
	"citizen": "Japanese",
	"flagUrl": "https://flagcdn.com/jp.svg",
	"callingCodes": ["81"],
	"timezones": ["UTC+09:00"],
	"latlng": [36, 138],
	"currencies": [{ "code": "JPY", "name": "Japanese yen", "symbol": "¥" }]
}

License

MIT © 2024 Rocktim Saikia

Keywords

FAQs

Package last updated on 05 Aug 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