react-country-flag-currency-picker
v1.1.0
Published
react-country-flag-currency-picker React component
Downloads
204
Maintainers
Readme
react-country-flag-currency-picker
A customizable svg flags,currency select components for React Js.
Installation
The package can be installed via NPM:
npm install react-country-flag-currency-picker --save
Usage
<ReactCountryFlagsCurrencySelect />
Default Country
You can select a default country to be rendered.
<ReactCountryFlagsCurrencySelect
defaultCountry="US" />
Searchable
You can enable search filter using prop searchable
.
<ReactCountryFlagsCurrencySelect
searchable={true} />
Search Placeholder
You can set the placeholder text for search using prop searchPlaceholder
.
<ReactCountryFlagsCurrencySelect
searchable={true}
searchPlaceholder="Search for a country" />
onSelect
You can use onSelect event handler which fires each time an option is selected.
onSelect(countryCode)
.
//onSelect Method
onSelectFlag(country){
console.log(country)
}
//component render
<ReactCountryFlagsCurrencySelect
defaultCountry="US"
onSelect={this.onSelectFlag} />