Gathering detailed insights and metrics for react-bootstrap-country-select
Gathering detailed insights and metrics for react-bootstrap-country-select
Gathering detailed insights and metrics for react-bootstrap-country-select
Gathering detailed insights and metrics for react-bootstrap-country-select
Country select form control with autosuggest for React Bootstrap
npm install react-bootstrap-country-select
Typescript
Module System
Node Version
NPM Version
TypeScript (84.46%)
JavaScript (13.56%)
SCSS (1.99%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
9 Stars
33 Commits
12 Forks
1 Watchers
2 Branches
2 Contributors
Updated on Feb 07, 2024
Latest Version
1.0.0
Package Id
react-bootstrap-country-select@1.0.0
Unpacked Size
928.02 kB
Size
187.35 kB
File Count
23
NPM Version
6.14.10
Node Version
12.19.0
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
3
27
A country select component with flag icons for React Bootstrap.
Go to the demos page to see it in action.
yarn add react-bootstrap-country-select
or
npm install react-bootstrap-country-select
React Bootstrap must be installed and the Bootstrap CSS imported (or included).
In your index.js
or similar:
1import 'bootstrap/dist/css/bootstrap.css'; // or include from a CDN 2import 'react-bootstrap-country-select/dist/react-bootstrap-country-select.css';
Your component:
1import React, { useState } from 'react'; 2import CountrySelect from 'react-bootstrap-country-select'; 3 4const MyComponent = () => { 5 6 const [ value, setValue ] = useState(null); 7 8 return ( 9 <CountrySelect 10 value={value} 11 onChange={setValue} 12 /> 13 ); 14 15};
sm
) and large (lg
) sizes are supportedProperty | Type | Default | Description |
---|---|---|---|
value | object | string | The current value: a country object, country ID or null. See valueAs . | |
onChange | function | A callback fired when a country is selected or unselected. The argument is the country object, country ID or null. | |
onTextChange | function | A callback fired when the input text changes. The first argument is the text value and the second argument is the input's change event object. | |
countries | array | An array of country objects used to populate the country list. Provide this if you'd like to use your own countries data. A country object has the properties: id , name , flag , alpha2 , alpha3 and ioc . | |
exclusions | array | An array of country IDs that defines the countries to be excluded from the country list. | |
additions | array | Additional countries in the same format as countries . | |
valueAs | object | id | object | Determines if value is a country object or an ID string. |
flags | boolean | true | Flags are displayed when true and not displayed when false . |
flush | boolean | true | When true the selected country flag appears in the input. When false it is rendered using <InputGroup.Text/> . |
disabled | boolean | false | Disables the country select. |
placeholder | string | "Type or select country..." | Placeholder text displayed in empty input. |
noMatchesText | string | "No matches" | The text displayed when no countries match the entered input text. |
size | 'sm' | 'lg' | Input size variants, for compatibility with other Bootstrap form components. | |
listMaxHeight | number | Maximum pixel height of the list overlay. | |
sort | function | A custom sort function that determines the order of the country list. The function's two arguments country objects. | |
matchNameFromStart | boolean | true | If true autosuggest matches country names from the start of the string. |
matchAbbreviations | boolean | false | If true autosuggest matches against alpha2, alpha3 and IOC abbreviations in addition to country names. |
countryLabelFormatter | function | A custom country list item formatter. The argument is a country object. | |
throwInvalidValueError | boolean | false | If true an error is thrown if the provided value does not match a country. |
| formControlProps
| object
| | Properties applied to the <FormControl/>
input. |
| overlayProps
| object
| | Properties applied to the overlay <div>
element that contains the country list. |
| classPrefix
| string
| 'country-select'
| Change the underlying component CSS base class name and modifier class names prefix. This is an escape hatch for working with heavily customized CSS. |
For further documentation and live examples visit the website.
If you have a usage query or feature request please create an issue.
Copyright (c) 2020 Jason Wilson
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/29 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
90 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