Socket
Socket
Sign inDemoInstall

react-country-dropdown

Package Overview
Dependencies
6
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-country-dropdown

A simple dropdown menu for selecting countries


Version published
Weekly downloads
405
increased by8.58%
Maintainers
1
Install size
40.1 kB
Created
Weekly downloads
 

Readme

Source

react-country-dropdown

A simple dropdown menu for selecting countries :rocket:

David GitHub npm bundle size GitHub package.json version

Install

npm install --save react-country-dropdown

Usage

import React, { Component } from 'react'

import { ReactCountryDropdown } from 'react-country-dropdown'
import 'react-country-dropdown/dist/index.css'

const Example = () => {
  const handleSelect = (country) => {
    console.log(country)
    /* returns the details on selected country as an object
    	{
          name: "United States of America", 
          code: "US", 
          capital: "Washington, D.C.", 
          region: "Americas", 
          latlng: [38, -97]
        }
    */
  }
  return (
    <div>
      <ReactCountryDropdown onSelect={handleSelect} countryCode='IN' />
    </div>
  )
}

(If you dont select set a default country with "countryCode" ; Then by default the selected country will US.)

License

MIT © RocktimSaikia

Keywords

FAQs

Last updated on 25 Mar 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc