Gathering detailed insights and metrics for custom-react-flags-select
Gathering detailed insights and metrics for custom-react-flags-select
Gathering detailed insights and metrics for custom-react-flags-select
Gathering detailed insights and metrics for custom-react-flags-select
Customizable svg flags select components for React Js
npm install custom-react-flags-select
Typescript
Module System
Node Version
NPM Version
61.7
Supply Chain
95.6
Quality
73.8
Maintenance
50
Vulnerability
99.6
License
JavaScript (83.48%)
CSS (8.45%)
SCSS (8.07%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
109 Commits
2 Branches
1 Contributors
Updated on Apr 12, 2021
Latest Version
0.0.1
Package Id
custom-react-flags-select@0.0.1
Unpacked Size
1.72 MB
Size
526.10 kB
File Count
457
NPM Version
6.9.0
Node Version
10.16.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
1
1
A customizable svg flags select components for React Js.
Live demo: ekwonye-richard.github.io/react-flags-select/
The package can be installed via NPM:
npm install react-flags-select --save
react-flags-select can be imported as follows
1import ReactFlagsSelect from 'react-flags-select'; 2 3//import css module 4import 'react-flags-select/css/react-flags-select.css'; 5 6//OR import sass module 7import 'react-flags-select/scss/react-flags-select.scss'; 8
1 <ReactFlagsSelect />
All country Codes: Country Codes
You can select a default country to be rendered.
1 <ReactFlagsSelect 2 defaultCountry="US" />
You can enable search filter using prop searchable
.
1 <ReactFlagsSelect 2 searchable={true} />
You can set the placeholder text for search using prop searchPlaceholder
.
1 <ReactFlagsSelect 2 searchable={true} 3 searchPlaceholder="Search for a country" />
You can use an array of countries rather than the full list of countries.
1 <ReactFlagsSelect 2 countries={["US", "GB", "FR", "DE", "IT", "NG"]} />
or create a black list of countries
1 <ReactFlagsSelect 2 countries={["US", "GB", "FR", "DE", "IT", "NG"]} 3 blackList={true} />
You can use an object of countries labels to replace the countries name. The default country name for a country will be used when the country code has no label passed.
1 <ReactFlagsSelect 2 countries={["US", "GB", "FR","DE","IT"]} 3 customLabels={{"US": "EN-US","GB": "EN-GB","FR": "FR","DE": "DE","IT": "IT"}} />
You can replace the default placeholder text.
1 <ReactFlagsSelect 2 countries={["US", "GB", "FR","DE","IT"]} 3 customLabels={{"US": "EN-US","GB": "EN-GB","FR": "FR","DE": "DE","IT": "IT"}} 4 placeholder="Select Language" />
You can hide or show the label of a selected flag. The default value is true.
1 <ReactFlagsSelect 2 countries={["US", "GB", "FR","DE","IT"]} 3 customLabels={{"US": "EN-US","GB": "EN-GB","FR": "FR","DE": "DE","IT": "IT"}} 4 placeholder="Select Language" 5 showSelectedLabel={false} />
You can hide or show the label of the flags in the options dropdown. The default value is true.
1 <ReactFlagsSelect 2 countries={["US", "GB", "FR","DE","IT"]} 3 customLabels={{"US": "EN-US","GB": "EN-GB","FR": "FR","DE": "DE","IT": "IT"}} 4 placeholder="Select Language" 5 showSelectedLabel={false} 6 showOptionLabel={false} />
You can set the size in pixels for the svg flag and label of the selected option.
1 <ReactFlagsSelect 2 countries={["US", "GB", "FR","DE","IT"]} 3 customLabels={{"US": "EN-US","GB": "EN-GB","FR": "FR","DE": "DE","IT": "IT"}} 4 placeholder="Select Language" 5 showSelectedLabel={false} 6 showOptionLabel={false} 7 selectedSize={14} />
You can set the size in pixels for the svg flags and labels in the options dropdown.
1 <ReactFlagsSelect 2 countries={["US", "GB", "FR","DE","IT"]} 3 customLabels={{"US": "EN-US","GB": "EN-GB","FR": "FR","DE": "DE","IT": "IT"}} 4 placeholder="Select Language" 5 showSelectedLabel={false} 6 showOptionLabel={false} 7 selectedSize={18} 8 optionsSize={14} />
You can pass a style className that will be attached to the top-level div
of the component.
1 <ReactFlagsSelect 2 className="menu-flags" />
You can align the options dropdown to either left or right. The default value is right.
1 <ReactFlagsSelect 2 alignOptions="left" />
You can disable the options dropdown, however the selected country can be updated using the updateSelected()
method. This can be used for flag badges.
1 <ReactFlagsSelect 2 defaultCountry="US" 3 showSelectedLabel={false} 4 disabled={true} />
You can use onSelect event handler which fires each time an option is selected.
onSelect(countryCode)
.
1 //onSelect Method 2 onSelectFlag(countryCode){ 3 console.log(countryCode) 4 } 5 6 //component render 7 <ReactFlagsSelect 8 defaultCountry="US" 9 onSelect={this.onSelectFlag} />
You can dynamically update the selected country on the component using updateSelected()
method.
1 //updateSelected Method 2 this.refs.userFlag.updateSelected("UK") 3 4 //component render 5 <ReactFlagsSelect 6 ref="userFlag" 7 defaultCountry="US" />
MIT Licensed. Copyright (c) Richard Ekwonye 2017.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
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
177 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