Gathering detailed insights and metrics for react-continent-country-select
Gathering detailed insights and metrics for react-continent-country-select
Gathering detailed insights and metrics for react-continent-country-select
Gathering detailed insights and metrics for react-continent-country-select
npm install react-continent-country-select
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (85.51%)
HTML (8.95%)
CSS (5.54%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
2 Stars
24 Commits
1 Forks
1 Watchers
5 Branches
1 Contributors
Updated on Mar 02, 2022
Latest Version
1.0.7
Package Id
react-continent-country-select@1.0.7
Unpacked Size
324.34 kB
Size
71.75 kB
File Count
8
NPM Version
6.14.4
Node Version
12.14.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
4
23
LIVE DEMO: https://mjakal.github.io/react-continent-country-select/
1npm install --save react-continent-country-select
1import React, { useState } from 'react'; 2import { 3 ContinentCountrySelect, 4 deserializeCountries, 5 serializeCountries 6} from 'react-continent-country-select'; 7import 'react-continent-country-select/dist/index.css'; 8import continents from 'react-continent-country-select/dist/continent_countries.json'; 9 10// pre-selected values from e.g. API endpoint 11const countries = ['be', 'nl', 'hr']; 12// Deserialize data: convert ['be', 'nl', 'hr'] to { BE: true, NL: true, HR: true } 13const deserializedCountries = deserializeCountries(countries); 14 15const App = () => { 16 const [selectedCountries, setSelectedCountries] = useState({ 17 ...deserializedCountries 18 }); 19 20 // You can create custom country component 21 const CountryComponent = ({ country }) => { 22 const code = country.code.toLowerCase(); 23 const label = `${country.name} (+${country.dial_code})`; 24 25 return ( 26 <span> 27 <i 28 style={{ width: '30px' }} 29 className={`flag-icon flag-icon-${code} mr-1`} 30 /> 31 {label} 32 </span> 33 ); 34 }; 35 36 const onChange = selected => setSelectedCountries({ ...selected }); 37 38 const onSerializeData = () => { 39 // Serialize selected countries 40 // The second boolean param is used for serializing data depending on your specific needs (upper/lower case) 41 const serializedCountries = serializeCountries(selectedCountries, false); 42 43 alert(`Selected Countries: \n ${JSON.stringify(serializedCountries)}`); 44 }; 45 46 return ( 47 <div> 48 <ContinentCountrySelect 49 continents={continents} // Required 50 selected={selectedCountries} // Required 51 toggleContinent={{ 52 AF: false, 53 AN: false, 54 AS: false, 55 OC: false, 56 EU: true, 57 NA: false, 58 SA: false 59 }} // Not required - by default everything is set to false 60 translations={{ 61 toggleText: 'Toggle', 62 notFoundText: 'No countries found.' 63 }} // Not required 64 customComponent={CountryComponent} // Not required 65 onChange={onChange} // Required 66 /> 67 <button type="button" onClick={onSerializeData}> 68 Serialize Selected Countries 69 </button> 70 </div> 71 ); 72}; 73 74export default App;
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/24 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
115 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More